Skip to content

Commit

Permalink
Ignore adding package name to draw/signature/selfie image questions
Browse files Browse the repository at this point in the history
  • Loading branch information
grzesiek2010 committed Sep 22, 2023
1 parent 257d33e commit 3b7d7c8
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions pyxform/xls2json.py
Original file line number Diff line number Diff line change
Expand Up @@ -1332,15 +1332,17 @@ def workbook_to_json(
)

if "app" in parameters.keys():
android_package_regex_pattern = (
"^[a-z][a-z0-9_]*(\.[a-z0-9_]+)+[0-9a-z_]$"
)
app_package_name = str(parameters["app"])
if re.fullmatch(android_package_regex_pattern, app_package_name):
new_dict["control"] = new_dict.get("control", {})
new_dict["control"].update({"intent": app_package_name})
else:
raise PyXFormError("Invalid Android package name format")
appearance = row.get("control", {}).get("appearance")
if appearance is None or appearance == "annotate":
android_package_regex_pattern = (
"^[a-z][a-z0-9_]*(\.[a-z0-9_]+)+[0-9a-z_]$"
)
app_package_name = str(parameters["app"])
if re.fullmatch(android_package_regex_pattern, app_package_name):
new_dict["control"] = new_dict.get("control", {})
new_dict["control"].update({"intent": app_package_name})
else:
raise PyXFormError("Invalid Android package name format.")

parent_children_array.append(new_dict)
continue
Expand Down

0 comments on commit 3b7d7c8

Please sign in to comment.