On August 19, the Qt repo added a new wasm release for Qt 6.2.0.
`list-qt` currently prints that the `wasm` extension is available for
that version of Qt, but it will not let the user use it to query
modules and architectures, because of a hardcoded version check.
This change rewrites the version check so that a user may make queries.
This also moves the `format_suggested_follow_up` function into the new
AqtException class, refactors `show_list` to use the new exceptions,
and tests the new code appropriately.
This alters `suggested_follow_up` to return a list of strings.
This makes testing easier, as well as making it easier to change the
way the suggestions are displayed.
This change also fixes an error in the suggestions ('list' was missing
from the suggested command), and fixes some punctuation errors.
This also adds a print formatter that displays the suggestions nicely
in the terminal.
`Versions.flattened()` returns a flat list of all the versions in the
Versions object, without any stratification by minor version.
This commit also updates the type hint for Versions.__iter__, which
returns a Generator.
* Introduce tooldata class
Signed-off-by: Hiroshi Miura <miurahr@linux.com>
* Refactoring list command
- Introduce show_list function that is part of UI
- ListCommand class can be used as library to retrieve metadata.
- Rename ListCommand to MetadataFactory
- Rename action method to getList
Signed-off-by: Hiroshi Miura <miurahr@linux.com>
This change adds a function that checks for obvious misuses of the
`--extension` flag, according to these rules:
1. On Qt6 for Android, an extension for processor architecture is
required.
2. On any platform other than Android, or on Qt5, an extension for
processor architecture is forbidden.
3. The "wasm" extension only works on desktop targets for Qt 5.13-5.15.
This validation function is only called on requests for 'modules' and
'architectures', because these are the only places where the version
of Qt is known and the extension matters. Hopefully, this change will
reduce confusion among users.
* Fix failure of requests for Qt 5.9.0
Currently, the following two commands fail with an HTTP 404 when they shouldn't:
```bash
aqt list qt5 windows desktop --modules 5.9.0
aqt list qt5 windows desktop --arch 5.9.0
```
This happens because ListCommand is looking for an xml file at `<base>/<host>/<target>/qt5_590/Updates.xml`; that file doesn't exist because it's actually at `<base>/<host>/<target>/qt5_59/Updates.xml`. So far, this is the only exception like this.
This change accounts for this exception.
* fix whitespace