Quellcode durchsuchen

CREATE THE THINGS

tags/v1.0^2
Ben Kurtovic vor 10 Jahren
Ursprung
Commit
0c68988982
5 geänderte Dateien mit 47 neuen und 1 gelöschten Zeilen
  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 Datei anzeigen

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

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

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


+ 9
- 0
bitshift/query/__init__.py Datei anzeigen

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

Laden…
Abbrechen
Speichern