return ext == f_ext
-apk_regex = None
+apk_regex = re.compile(r"^(.+)_([0-9]+)\.apk$")
def clean_description(description):
def apknameinfo(filename):
- global apk_regex
filename = os.path.basename(filename)
- if apk_regex is None:
- apk_regex = re.compile(r"^(.+)_([0-9]+)\.apk$")
m = apk_regex.match(filename)
try:
result = (m.group(1), m.group(2))
return sorted(builds, key=lambda build: int(build.vercode))
+esc_newlines = re.compile('\\\\( |\\n)')
+
+
def post_metadata_parse(app):
for f in app_fields:
text = v.rstrip().lstrip()
app.set_field(f, text.split('\n'))
- esc_newlines = re.compile('\\\\( |\\n)')
-
for build in app.builds:
for k in build_flags:
v = build.get_flag(k)
return app
+build_line_sep = re.compile(r"(?<!\\),")
+
+
def parse_txt_metadata(metadatapath):
linedesc = None
def parse_buildline(lines):
v = "".join(lines)
- parts = [p.replace("\\,", ",")
- for p in re.split(r"(?<!\\),", v)]
+ parts = [p.replace("\\,", ",") for p in re.split(build_line_sep, v)]
if len(parts) < 3:
raise MetaDataException("Invalid build format: " + v + " in " + metafile.name)
build = Build()