(fix=False)
| 230 | |
| 231 | |
| 232 | def check_ios(fix=False): |
| 233 | ok = True |
| 234 | for locale in glob.glob(f'{IOS_META_PATH}/*/'): |
| 235 | if locale.split('/')[-2] not in APPSTORE_LOCALES: |
| 236 | error(locale, "unsupported locale") |
| 237 | if fix: |
| 238 | drop_locale(locale) |
| 239 | ok = False |
| 240 | else: |
| 241 | locale_ok = check_text(locale + "subtitle.txt", 30, False, True) |
| 242 | locale_ok = check_text(locale + "description.txt", 4000, False, True) and locale_ok |
| 243 | locale_ok = check_text(locale + "keywords.txt", 100, False, True) and locale_ok |
| 244 | locale_ok = check_text(locale + "release_notes.txt", 4000, True, True) and locale_ok |
| 245 | locale_ok = check_url(locale + "support_url.txt", True) and locale_ok |
| 246 | locale_ok = check_url(locale + "marketing_url.txt", True) and locale_ok |
| 247 | locale_ok = check_url(locale + "privacy_url.txt", True) and locale_ok |
| 248 | done(locale, locale_ok) |
| 249 | if not locale_ok: |
| 250 | error(locale, 'locale is INVALID or INCOMPLETE') |
| 251 | if fix: |
| 252 | drop_locale(locale) |
| 253 | ok = False |
| 254 | |
| 255 | if not ok: |
| 256 | if fix: |
| 257 | print(f'FIXED by removing invalid locales from {IOS_META_PATH}') |
| 258 | return True |
| 259 | else: |
| 260 | error(IOS_META_PATH, 'HAS INVALID LOCALES') |
| 261 | return False |
| 262 | else: |
| 263 | print(f'metadata is OK {IOS_META_PATH}') |
| 264 | return True |
| 265 | |
| 266 | if __name__ == "__main__": |
| 267 | parser = ArgumentParser(description="Check AppStore / Google Play / F-Droid metadata") |
no test coverage detected