Skip to content

Commit

Permalink
Add Fenix locale handling (#671)
Browse files Browse the repository at this point in the history
  • Loading branch information
piri-p authored May 6, 2024
1 parent 7345795 commit f9c501c
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 6 deletions.
11 changes: 5 additions & 6 deletions mozdownload/scraper.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,13 +124,12 @@ def __init__(self, destination=None, platform=None,

self.destination = destination or os.getcwd()

if not locale:
if application in APPLICATIONS_MULTI_LOCALE:
self.locale = 'multi'
else:
self.locale = 'en-US'
else:
if application in APPLICATIONS_MULTI_LOCALE:
self.locale = 'multi'
elif locale:
self.locale = locale
else:
self.locale = 'en-US'
self.locale_build = self.locale not in ('en-US', 'multi')

self.platform = platform or self.detect_platform()
Expand Down
3 changes: 3 additions & 0 deletions tests/daily_scraper/test_daily_scraper.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,9 @@
({'application': 'fenix', 'platform': 'android-x86_64', 'date': '2022-11-14'},
'2022-11-14-17-01-36-fenix-108.0b1.multi.android-x86_64.apk',
'fenix/nightly/2022/11/2022-11-14-17-01-36-fenix-108.0b1-android-x86_64/fenix-108.0b1.multi.android-x86_64.apk'),
({'application': 'fenix', 'platform': 'android-arm64-v8a', 'date': '2022-11-14', 'locale': 'de'},
'2022-11-14-17-01-36-fenix-108.0b1.multi.android-arm64-v8a.apk',
'fenix/nightly/2022/11/2022-11-14-17-01-36-fenix-108.0b1-android-arm64-v8a/fenix-108.0b1.multi.android-arm64-v8a.apk'),
]

@pytest.mark.parametrize("args,filename,url", firefox_tests + thunderbird_tests + fenix_tests)
Expand Down
3 changes: 3 additions & 0 deletions tests/release_scraper/test_release_scraper.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@
({'application': 'fenix', 'platform': 'android-x86_64', 'version': '120.1.0'},
'fenix-120.1.0.multi.android-x86_64.apk',
'fenix/releases/120.1.0/android/fenix-120.1.0-android-x86_64/fenix-120.1.0.multi.android-x86_64.apk'),
({'application': 'fenix', 'platform': 'android-arm64-v8a', 'version': '120.1.0', 'locale': 'de'},
'fenix-120.1.0.multi.android-arm64-v8a.apk',
'fenix/releases/120.1.0/android/fenix-120.1.0-android-arm64-v8a/fenix-120.1.0.multi.android-arm64-v8a.apk'),
({'platform': 'win32', 'version': '23.0.1'},
'firefox-23.0.1.en-US.win32.exe',
'firefox/releases/23.0.1/win32/en-US/Firefox Setup 23.0.1.exe'),
Expand Down
3 changes: 3 additions & 0 deletions tests/release_scraper/test_release_scraper_latest.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@
({'application': 'fenix', 'platform': 'android-x86_64', 'version': 'latest-beta'},
'fenix-120.0b9.multi.android-x86_64.apk',
'fenix/releases/120.0b9/android/fenix-120.0b9-android-x86_64/fenix-120.0b9.multi.android-x86_64.apk'),
({'application': 'fenix', 'platform': 'android-arm64-v8a', 'version': 'latest', 'locale': 'de'},
'fenix-120.1.0.multi.android-arm64-v8a.apk',
'fenix/releases/120.1.0/android/fenix-120.1.0-android-arm64-v8a/fenix-120.1.0.multi.android-arm64-v8a.apk'),
({'application': 'firefox', 'platform': 'linux', 'version': 'latest'},
'firefox-23.0.1.en-US.linux.tar.bz2',
'firefox/releases/23.0.1/linux-i686/en-US/firefox-23.0.1.tar.bz2'),
Expand Down

0 comments on commit f9c501c

Please sign in to comment.