chiark / gitweb /
always hide PIL.PngImagePlugin's "STREAM" debug messages
[fdroidserver.git] / fdroidserver / common.py
index 5d35f3c79d053b80e905e0a8113b9b2ff3c60cb9..8248a9441349f3c06b87eb66f0706db7ed7a8dee 100644 (file)
@@ -128,6 +128,13 @@ default_config = {
 
 
 def setup_global_opts(parser):
+    try:  # the buildserver VM might not have PIL installed
+        from PIL import PngImagePlugin
+        logger = logging.getLogger(PngImagePlugin.__name__)
+        logger.setLevel(logging.INFO)  # tame the "STREAM" debug messages
+    except ImportError:
+        pass
+
     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,
@@ -1338,7 +1345,7 @@ def parse_androidmanifests(paths, app):
             with open(path, 'r') as f:
                 buildfile = f.read()
 
-                regex_string = r"" + flavour + ".*?}"
+                regex_string = r"" + flavour + "[^}]*?{.*?}"
                 search = re.compile(regex_string, re.DOTALL)
                 result = search.search(buildfile)