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 4a54e64
Showing 1 changed file with 15 additions and 9 deletions.
24 changes: 15 additions & 9 deletions pyxform/xls2json.py
Original file line number Diff line number Diff line change
Expand Up @@ -1332,15 +1332,21 @@ 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 != "signature"
and appearance != "draw"
and appearance != "new-front"
):
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 4a54e64

Please sign in to comment.