changeset 36:3a7e8aa80328

move this to an instance method for consumption
author Jeff Hammel <jhammel@mozilla.com>
date Tue, 08 Jan 2013 14:30:13 -0800
parents 61d2bb7a3ca0
children cbf6ec238952
files mozillatry.py
diffstat 1 files changed, 14 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/mozillatry.py	Tue Jan 08 14:10:31 2013 -0800
+++ b/mozillatry.py	Tue Jan 08 14:30:13 2013 -0800
@@ -174,25 +174,29 @@
                        if key in self.option_dict])
         return config
 
+    ### methods for try on mozilla-central
+
+    def try_syntax(self):
+        return try_syntax(opt=self.config.get('opt'),
+                          debug=self.config.get('debug'),
+                          unittests=self.config.get('unittests', []),
+                          talos=self.config.get('talostests', []),
+                          bug=self.config.get('bug'))
+
 def main(args=sys.argv[1:]):
 
     # parse command line arguments
-    parser = MozillaTryConfiguration()
-    options, args = parser.parse_args()
+    mozillatry = MozillaTryConfiguration()
+    options, args = mozillatry.parse_args()
     if not args:
-        parser.print_usage()
-        parser.exit()
+        mozillatry.print_usage()
+        mozillatry.exit()
 
     # get mozilla-central repository directory
     try_directory = options.mozilla_central
 
     # build try syntax
-    commit = try_syntax(opt=options.opt,
-                        debug=options.debug,
-                        unittests=options.unittests,
-                        talos=options.talostests,
-                        bug=options.bug
-                        )
+    commit = mozillatry.try_syntax()
     print commit
 
     # push to try