diff options
author | 2016-09-07 00:19:29 +0300 | |
---|---|---|
committer | 2016-09-07 00:20:02 +0300 | |
commit | 6d5b0a5ba688677a127d1df1439080482c9709d1 (patch) | |
tree | 52722eb53bd8d53f440ffedad08c2722e6bcf702 /manage.py | |
parent | Initial start of new Project Grumpy code; Hello World! (diff) | |
download | grumpy-6d5b0a5ba688677a127d1df1439080482c9709d1.tar.gz grumpy-6d5b0a5ba688677a127d1df1439080482c9709d1.tar.bz2 grumpy-6d5b0a5ba688677a127d1df1439080482c9709d1.zip |
Add initial code to sync categories from packages.g.o with associated plumbing
Now this should make http://localhost:5000 show the available categories:
./manage.py init
./manage.py sync_gentoo
./manage.py runserver
Diffstat (limited to 'manage.py')
-rwxr-xr-x | manage.py | 15 |
1 files changed, 13 insertions, 2 deletions
@@ -3,15 +3,26 @@ from flask_script import Manager, Shell -from backend import app +from backend import app, db +from backend.lib.sync import sync_categories manager = Manager(app) def shell_context(): - return dict(app=manager.app) + return dict(app=manager.app, db=db) manager.add_command('shell', Shell(make_context=shell_context)) +@manager.command +def init(): + """Initialize empty database with tables""" + db.create_all() + +@manager.command +def sync_gentoo(): + """Syncronize Gentoo data from packages.gentoo.org API""" + sync_categories() + if __name__ == '__main__': manager.run() |