Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix source/doc/examples with qstkdrepo changes. #857

Merged
merged 6 commits into from
Dec 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading