From 9bb1ac748de837a1e8c3611b900f666e90ec3227 Mon Sep 17 00:00:00 2001 From: Tim Flink Date: Apr 01 2014 19:40:26 +0000 Subject: moving 'if name == main' code to main() to allow external use, removing un-needed imports --- diff --git a/fake_fedorainfra/cli.py b/fake_fedorainfra/cli.py index c79b57b..b8b62f6 100644 --- a/fake_fedorainfra/cli.py +++ b/fake_fedorainfra/cli.py @@ -28,7 +28,6 @@ import sys from fake_fedorainfra import db from fake_fedorainfra.models.user import User -from fake_fedorainfra.models.bodhi import BodhiComment def initialize_db(): @@ -45,9 +44,7 @@ def mock_data(): db.session.commit() - -if __name__ == '__main__': - +def main(): possible_commands = ['init_db', 'mock_data'] usage = 'usage: [DEV=true] %prog ' + "(%s)" % ' | '.join(possible_commands)