kopia lustrzana https://github.com/glidernet/ogn-python
23 wiersze
486 B
Python
Executable File
23 wiersze
486 B
Python
Executable File
from ogn.model import Base
|
|
|
|
from manager import Manager
|
|
manager = Manager()
|
|
|
|
from ogn.collect.fetchddb import update_ddb_data
|
|
|
|
@manager.command
|
|
def init():
|
|
"""Initialize the database."""
|
|
from dbutils import engine
|
|
Base.metadata.create_all(engine)
|
|
print("Done.")
|
|
|
|
|
|
@manager.command
|
|
def updateddb():
|
|
"""Update the ddb data."""
|
|
print("Updating ddb data...")
|
|
result = update_ddb_data.delay()
|
|
counter = result.get()
|
|
print("Imported %i devieces."%counter)
|