From 4a5d3d534c2dea3e757b6803dcde27238e892b59 Mon Sep 17 00:00:00 2001 From: Siddharth Ravikumar Date: Thu, 5 Feb 2015 21:14:12 -0500 Subject: combox/cbox.py: put the code under __main__ into a new function called 'main()' main() is called from __main__ now. --- combox/cbox.py | 10 ++++++++-- 1 file 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() -- cgit v1.2.3