Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-81344

Clean up the CLDR-digestion python scripts

    XMLWordPrintable

Details

    • User Story
    • Resolution: Done
    • P2: Important
    • 6.0
    • 5.14.0
    • Core: Locales (i18n)
    • None
    • All
    • 21
    • Qt6_Foundation_ Sprint 3, Qt6_Foundation_ Sprint 4, Qt6_Foundation_ Sprint 5, Qt6_Foundation_ Sprint 6

    Description

      The scripts in util/locale_database/ could be significantly improved:

      • When something goes wrong, I can't import the script as a module and investigate what's going wrong in an interactive python session: importing the script runs it. It should define suitable classes and functions, then use an if _name_ == '_main_' block at the end to actually run the script.
      • cldr2qlocalexml.py prints its output (i.e. writes it to sys.stdout), rather than taking the name of a file to which to write the output. Given that it also grumbles extensively on sys.stderr, this only makes sense if one is redirecting stdout to a file; and I've had to kludge the script to ensure sys.stdout.encoding is UTF-8, since it's apt to be None and mean ASCII, to which some of our data can't be encoded. So it would be better to write to a file named on the command-line (we can continue the time-honoured tradition of letting - as output-file mean write to stdout, and/or continue writing to stdout if no output file is specified) instead of printing.
      • Everything needs to be fed to six and converted to python3, as it's currently all python2; it might also be constructive to add mypy type annotations to it.

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              Eddy Edward Welbourne
              Eddy Edward Welbourne
              Maurice Kalinowski Maurice Kalinowski
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: