Skip to content

Commit

Permalink
Updated texts
Browse files Browse the repository at this point in the history
  • Loading branch information
vloothuis committed Dec 6, 2023
1 parent 6db584d commit e4d4a41
Showing 1 changed file with 16 additions and 14 deletions.
30 changes: 16 additions & 14 deletions src/framework/processing/py/port/script.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def parse_json_to_dataframe(parsed_dict):
segment = obj["activitySegment"]
activity_type = segment["activityType"]

if activity_type not in {"WALKING", "CYCLING","RUNNING"}:
if activity_type not in {"WALKING", "CYCLING", "RUNNING"}:
continue

start_timestamp_str = segment["duration"]["startTimestamp"]
Expand Down Expand Up @@ -129,8 +129,10 @@ def process(sessionId):
else:
meta_data.append(("debug", f"retry prompt file"))
break
if extractionResult == 'no-data':
retry_result = yield render_donation_page(retry_no_data_confirmation(), 33)
if extractionResult == "no-data":
retry_result = yield render_donation_page(
retry_no_data_confirmation(), 33
)
if retry_result.__type__ == "PayloadTrue":
continue
else:
Expand Down Expand Up @@ -163,13 +165,12 @@ def render_end_page():


def render_donation_page(body, progress):
header = props.PropsUIHeader(props.Translatable({
"en": "Google activity",
"nl": "Google activity"
}))
header = props.PropsUIHeader(
props.Translatable({"en": "Google location", "nl": "Google locatie"})
)

footer = props.PropsUIFooter(progress)
page = props.PropsUIPageDonation("google-activity", header, body, footer)
page = props.PropsUIPageDonation("google-location", header, body, footer)
return CommandUIRender(page)


Expand All @@ -184,6 +185,7 @@ def retry_confirmation():
cancel = props.Translatable({"en": "Continue", "nl": "Verder"})
return props.PropsUIPromptConfirm(text, ok, cancel)


def retry_no_data_confirmation():
text = props.Translatable(
{
Expand All @@ -196,19 +198,19 @@ def retry_no_data_confirmation():
return props.PropsUIPromptConfirm(text, ok, cancel)



def prompt_file():
description = props.Translatable({
"en": f"Please follow the download instructions and choose the file that you stored on your device. Click 'Skip' at the right bottom, if you do not have a file. ",
"nl": f"Volg de download instructies en kies het bestand dat u opgeslagen heeft op uw apparaat. Als u geen bestand heeft klik dan op 'Overslaan' rechts onder.",
})
description = props.Translatable(
{
"en": f"Click 'Choose file' to choose the file that you received from Google. If you click 'Continue', the data that is required for research is extracted from your file.",
"nl": f"Klik op ‘Kies bestand’ om het bestand dat u ontvangen hebt van Google te kiezen. Als u op 'Verder' klikt worden de gegevens die nodig zijn voor het onderzoek uit uw bestand gehaald.",
}
)

return props.PropsUIPromptFileInput(description, "application/zip")


def prompt_consent(tables, meta_data):
log_title = props.Translatable({"en": "Log messages", "nl": "Log berichten"})

tables = [
props.PropsUIPromptConsentFormTable(table.id, table.title, table.data_frame)
for table in tables
Expand Down

0 comments on commit e4d4a41

Please sign in to comment.