chiark / gitweb /
Switch all headers to python3
[fdroidserver.git] / fdroidserver / install.py
index 5339319fb69b2bb60ca4a7b4460a967c102f8fc1..ebb66232a1b2a65d05c583a6bb0f01eb4e091029 100644 (file)
@@ -1,5 +1,4 @@
-#!/usr/bin/env python2
-# -*- coding: utf-8 -*-
+#!/usr/bin/env python3
 #
 # install.py - part of the FDroid server tools
 # Copyright (C) 2013, Ciaran Gultnieks, ciaran@ciarang.com
@@ -35,9 +34,7 @@ def devices():
     p = SdkToolsPopen(['adb', "devices"])
     if p.returncode != 0:
         raise FDroidException("An error occured when finding devices: %s" % p.output)
-    lines = p.output.splitlines()
-    if lines[0].startswith('* daemon not running'):
-        lines = lines[2:]
+    lines = [l for l in p.output.splitlines() if not l.startswith('* ')]
     if len(lines) < 3:
         return []
     lines = lines[1:-1]
@@ -50,11 +47,8 @@ def main():
 
     # Parse command line...
     parser = ArgumentParser(usage="%(prog)s [options] [APPID[:VERCODE] [APPID[:VERCODE] ...]]")
+    common.setup_global_opts(parser)
     parser.add_argument("appid", nargs='*', help="app-id with optional versioncode in the form APPID[:VERCODE]")
-    parser.add_argument("-v", "--verbose", action="store_true", default=False,
-                        help="Spew out even more information than normal")
-    parser.add_argument("-q", "--quiet", action="store_true", default=False,
-                        help="Restrict output to warnings and errors")
     parser.add_argument("-a", "--all", action="store_true", default=False,
                         help="Install all signed applications available")
     options = parser.parse_args()