Separate actual functionality out into a separate function.

master
Simon Quigley 5 years ago
parent 0b5b5a9a8e
commit 2c1227c0ee

@ -20,6 +20,7 @@ from modules.jenkins import JenkinsModule
ENABLED_MODULES = [JenkinsModule] ENABLED_MODULES = [JenkinsModule]
def sqlite_run(command, db=":memory:"): def sqlite_run(command, db=":memory:"):
"""Run the given SQLite command on our db """Run the given SQLite command on our db
@ -32,8 +33,14 @@ def sqlite_run(command, db=":memory:"):
conn.commit() conn.commit()
conn.close() conn.close()
if __name__ == "__main__":
for module in ENABLED_MODULES: def main(module):
"""Given a specific module, set it up and insert recent values"""
module = module() module = module()
sqlite_run(module.sqlite_setup()) sqlite_run(module.sqlite_setup())
sqlite_run(module.sqlite_add()) sqlite_run(module.sqlite_add())
if __name__ == "__main__":
for module in ENABLED_MODULES:
main(module)

Loading…
Cancel
Save