Ben Kurtovic 10 лет назад
Родитель
Сommit
0c68988982
5 измененных файлов: 47 добавлений и 1 удалений
  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 Просмотреть файл

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

from bitshift import *
from bitshift.query import parse_query

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

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

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

+ 13
- 0
bitshift/codelet.py Просмотреть файл

@@ -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 Просмотреть файл

@@ -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


+ 9
- 0
bitshift/query/__init__.py Просмотреть файл

@@ -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

Загрузка…
Отмена
Сохранить