import subprocess
from argparse import ArgumentParser
import traceback
-from html.parser import HTMLParser
+import html
from distutils.version import LooseVersion
import logging
import copy
return (None, msg)
-def check_repotrunk(app, branch=None):
+def check_repotrunk(app):
try:
if app.RepoType == 'srclib':
req = urllib.request.Request(url, None, headers)
try:
resp = urllib.request.urlopen(req, None, 20)
- page = resp.read()
+ page = resp.read().decode()
except urllib.error.HTTPError as e:
return (None, str(e.code))
except Exception as e:
m = re.search('itemprop="softwareVersion">[ ]*([^<]+)[ ]*</div>', page)
if m:
- html_parser = HTMLParser()
- version = html_parser.unescape(m.group(1))
+ version = html.unescape(m.group(1))
if version == 'Varies with device':
return (None, 'Device-variable version, cannot use this method')
return commitmsg
-def checkupdates_app(app, first=True):
+def checkupdates_app(app):
# If a change is made, commitmsg should be set to a description of it.
# Only if this is set will changes be written back to the metadata.
apps = common.read_app_args(options.appid, allapps, False)
if options.gplay:
- for app in apps:
+ for appid, app in apps.items():
version, reason = check_gplay(app)
if version is None:
if reason == '404':