summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSiddharth Ravikumar <sravik@bgsu.edu>2015-02-05 21:14:12 -0500
committerSiddharth Ravikumar <sravik@bgsu.edu>2015-02-05 21:14:12 -0500
commit4a5d3d534c2dea3e757b6803dcde27238e892b59 (patch)
treedfc7e96ec66f3e880aa58363bd39e70e45c9fb85
parent7dffc3c9570105300584986f4740c1bd18094d6f (diff)
combox/cbox.py: put the code under __main__ into a new function called 'main()'
main() is called from __main__ now.
-rw-r--r--combox/cbox.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/combox/cbox.py b/combox/cbox.py
index 52c7546..4424274 100644
--- a/combox/cbox.py
+++ b/combox/cbox.py
@@ -53,8 +53,10 @@ def run_cb(config):
observer.join()
-if __name__ == "__main__":
-
+def main():
+ """
+ Main functions, parses args and calls run_cb()
+ """
parser = ArgumentParser()
parser.add_argument("-t", "--test",
help="Use the combox config file in testing area.",
@@ -80,3 +82,7 @@ if __name__ == "__main__":
# run combox.
run_cb(config)
+
+
+if __name__ == "__main__":
+ main()