Tzinov15/FlagFinder — pull request #26 by kinnairdclan (2014-11-30 05:07:09+00:00)
Title: Jkinnard

I'm changing my implementation to provide a ff_db class. Cleaner to read and waaay easier to test. Invoked as follows:

db = database.ff_db('/home/jrk/project_rootdir', 'projectdbname')

if not yet created the constructor here will create a sqlite database: /home/jrk/project_rootdir/.ff/projectdbname.

db.add_entry(db_entry)

this will add an entry to our sqlite db. Argument db_entry is currently a passed-in namedtuple with three entries I spotted in parse.py: ('file', 'comment_line_number', 'comment_line'). Obviously this can change and in the future I want to know *exactly* what you guys want stored in the db.

db.retrieve(self, query_type, *db_search_query)

currently just prints out what it finds in the db, so long as the passed-in query_type is 'file' and the db_search_query is some complete filename. Rudimentary, will expand in functionality in the future.