chiark / gitweb /
Apply some autopep8-python2 suggestions
[fdroidserver.git] / fdroid
diff --git a/fdroid b/fdroid
index 999b667505fc86a616f4b0f47a0ac6796bc4bf2f..ab901a7bb8038d15382b1f150cb9d7a569cea5e9 100755 (executable)
--- a/fdroid
+++ b/fdroid
@@ -22,6 +22,7 @@ import sys
 import logging
 
 from fdroidserver.common import FDroidException
+from optparse import OptionError
 
 commands = {
     "build": "Build a package from source",
@@ -39,7 +40,7 @@ commands = {
     "scanner": "Scan the source code of a package",
     "stats": "Update the stats of the repo",
     "server": "Interact with the repo HTTP server",
-    }
+}
 
 
 def print_help():
@@ -69,9 +70,6 @@ def main():
 
     verbose = any(s in sys.argv for s in ['-v', '--verbose'])
     quiet = any(s in sys.argv for s in ['-q', '--quiet'])
-    if verbose and quiet:
-        print "Specifying verbose and quiet and the same time is silly"
-        sys.exit(1)
 
     if verbose:
         logging.basicConfig(format='%(levelname)s: %(message)s', level=logging.DEBUG)
@@ -80,6 +78,10 @@ def main():
     else:
         logging.basicConfig(format='%(message)s', level=logging.INFO)
 
+    if verbose and quiet:
+        logging.critical("Specifying --verbose and --quiet and the same time is silly")
+        sys.exit(1)
+
     # Trick optparse into displaying the right usage when --help is used.
     sys.argv[0] += ' ' + command
 
@@ -95,6 +97,9 @@ def main():
         else:
             logging.critical(str(e))
         sys.exit(1)
+    except OptionError, e:
+        logging.critical(str(e))
+        sys.exit(1)
     except KeyboardInterrupt:
         print('')
         sys.exit(1)