Browse Source

CREATE THE THINGS

tags/v1.0^2
Ben Kurtovic 10 years ago
parent
commit
0c68988982
5 changed files with 47 additions and 1 deletions
  1. +7
    -1
      app.py
  2. +13
    -0
      bitshift/codelet.py
  3. +18
    -0
      bitshift/database.py
  4. +0
    -0
     
  5. +9
    -0
      bitshift/query/__init__.py

+ 7
- 1
app.py View File

@@ -5,7 +5,7 @@ Module to contain all the project's Flask server plumbing.
from flask import Flask from flask import Flask
from flask import render_template, session from flask import render_template, session


from bitshift import *
from bitshift.query import parse_query


app = Flask(__name__) app = Flask(__name__)
app.config.from_object("bitshift.config") app.config.from_object("bitshift.config")
@@ -18,5 +18,11 @@ app_env.globals.update(assets = assets)
def index(): def index():
return render_template("index.html") return render_template("index.html")


@app.route("/search/<query>")
def search(query):
## tree = parse_query(query)
## database.search(tree)
pass

if __name__ == "__main__": if __name__ == "__main__":
app.run() app.run()

+ 13
- 0
bitshift/codelet.py View File

@@ -0,0 +1,13 @@
__all__ = ["Codelet"]

class Codelet(object):
## object to store the following (it doesn't need to do anything with it):
## author name, URL, date created/modified, language, source code itself
## for VCS: project name, file in project
## also: list of functions, etc (associations data)

## DICTIONARY MAPPING STRINGS REPRESENTING ASSOCIATION TYPE WITH DICTIONARIES
## MAPPING ASSOCIATION NAMES WITH TUPLES REPRESENTING THEIR PLACE IN THE FILE
## STORED AS TWO INTEGERS REPRESENTING THE ROW AND THE COLUMN

## {"functions": {"foo": (12, 13), "bar": (53, 3)}}

+ 18
- 0
bitshift/database.py View File

@@ -0,0 +1,18 @@
"""
Module with classes and functions to handle communication with the MySQL
database backend, which manages the search index.
"""

import oursql

class Database(object):
"""Represents the MySQL database."""

def __init__(self):
pass

def _connect(self):
pass

def _create(self):
pass

+ 0
- 0
View File


+ 9
- 0
bitshift/query/__init__.py View File

@@ -0,0 +1,9 @@
from .association import Association
from .node import Node
from .tree import Tree

__all__ = ["parse_query"]

def parse_query(query):
# gets a string, returns a Tree
pass

Loading…
Cancel
Save