| @@ -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() | ||||
| @@ -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)}} | |||||
| @@ -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 +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 | |||||