Skip to content

Commit

Permalink
fix source/doc/examples with qstkdrepo changes. (#857)
Browse files Browse the repository at this point in the history
* fix source/doc/examples with qstkdrepo changes.

This handles all_os/qt/qt6_xyz_src_doc_examples changing
to all_os/qt/qt6/xyz/[unix|windows]_line_endings_src
for both list and install commands.

* configure pylint max-line-length to match others.

* Revert "configure pylint max-line-length to match others."

This reverts commit 8ebba90.
  • Loading branch information
tsteven4 authored Dec 21, 2024
1 parent 3f2f59d commit f914397
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 4 deletions.
2 changes: 1 addition & 1 deletion aqt/archives.py
Original file line number Diff line number Diff line change
Expand Up @@ -623,7 +623,7 @@ def __init__(
)

def _arch_ext(self) -> str:
return "_src_doc_examples"
return "_" + QtRepoProperty.sde_ext(self.version)

def _base_module_name(self) -> str:
"""
Expand Down
23 changes: 20 additions & 3 deletions aqt/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
import itertools
import operator
import os
import posixpath
import re
import secrets as random
Expand Down Expand Up @@ -275,7 +276,7 @@ def to_url(self) -> str:
)

def to_folder(self, version: Version, qt_version_no_dots: str, extension: Optional[str] = None) -> str:
if version >= Version("6.8.0"):
if (version >= Version("6.8.0")) and not ((self.host == "all_os") and (self.target == "qt")):
return "{category}{major}_{ver}/{category}{major}_{ver}{ext}".format(
category=self.category,
major=qt_version_no_dots[0],
Expand Down Expand Up @@ -569,6 +570,16 @@ def known_extensions(version: Version) -> List[str]:
return ["qtpdf", "qtwebengine"]
return []

@staticmethod
def sde_ext(version: Version) -> str:
if version >= Version("6.8.0"):
if os.linesep == "\r\n":
return "windows_line_endings_src"
else:
return "unix_line_endings_src"
else:
return "src_doc_examples"


class MetadataFactory:
"""Retrieve metadata of Qt variations, versions, and descriptions from Qt site."""
Expand Down Expand Up @@ -973,7 +984,9 @@ def fetch_modules_sde(self, cmd_type: str, version: Version) -> List[str]:
"qt",
), "Internal misuse of fetch_modules_sde"
qt_ver_str = self._get_qt_version_str(version)
modules_meta = self._fetch_module_metadata(self.archive_id.to_folder(version, qt_ver_str, "src_doc_examples"))
modules_meta = self._fetch_module_metadata(
self.archive_id.to_folder(version, qt_ver_str, QtRepoProperty.sde_ext(version))
)
# pattern: Match all names "qt.qt5.12345.doc.(\w+)
pattern = re.compile(r"^qt\.(qt" + str(version.major) + r"\.)?" + qt_ver_str + r"\." + cmd_type + r"\.(.+)$")

Expand All @@ -993,7 +1006,11 @@ def fetch_archives_sde(self, cmd_type: str, version: Version) -> List[str]:
return self.fetch_archives(version, cmd_type, [], is_sde=True)

def fetch_archives(self, version: Version, arch: str, modules: List[str], is_sde: bool = False) -> List[str]:
extension = "src_doc_examples" if is_sde else QtRepoProperty.extension_for_arch(arch, version >= Version("6.0.0"))
extension = (
QtRepoProperty.sde_ext(version)
if is_sde
else QtRepoProperty.extension_for_arch(arch, version >= Version("6.0.0"))
)
qt_version_str = self._get_qt_version_str(version)
nonempty = MetadataFactory._has_nonempty_downloads

Expand Down

0 comments on commit f914397

Please sign in to comment.