Skip to content

Conversation

andrii-suse
Copy link
Collaborator

followup from #307

@foursixnine foursixnine merged commit 69cbb32 into master Jul 30, 2025
5 checks passed
@foursixnine foursixnine deleted the fix_factory_read_files_repopath branch July 30, 2025 09:39
else:
repopath = (
self.ag.productrepopath() + "/" + self.folder + "/*" + repodir.attrib["folder"] + "*" + suffix
)
Copy link

@d3flex d3flex Jul 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
)
if "/" in self.folder:
prd_path = self.ag.productpath
else:
prd_path = self.ag.productrepopath()
glob_pattern = f"*{repodir.attrib['folder']}*{suffix}"
repopath = (os.path.join(prd_path, self.folder, glob_pattern))

I think this reduce the duplication

Comment on lines +662 to +668
repopath = ""
if "/" in self.folder:
repopath = self.ag.productpath + "/" + self.folder + "/*" + repodir.attrib["folder"] + "*" + suffix
else:
repopath = (
self.ag.productrepopath() + "/" + self.folder + "/*" + repodir.attrib["folder"] + "*" + suffix
)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
repopath = ""
if "/" in self.folder:
repopath = self.ag.productpath + "/" + self.folder + "/*" + repodir.attrib["folder"] + "*" + suffix
else:
repopath = (
self.ag.productrepopath() + "/" + self.folder + "/*" + repodir.attrib["folder"] + "*" + suffix
)
repopath = self.ag.productpath + "/" + self.folder + "/*" + repodir.attrib["folder"] + "*" + suffix if "/" in self.folder else ( self.ag.productrepopath() + "/" + self.folder + "/*" + repodir.attrib["folder"] + "*" + suffix )

wrapped accordingly of course. Probably easier to read if written like this

Suggested change
repopath = ""
if "/" in self.folder:
repopath = self.ag.productpath + "/" + self.folder + "/*" + repodir.attrib["folder"] + "*" + suffix
else:
repopath = (
self.ag.productrepopath() + "/" + self.folder + "/*" + repodir.attrib["folder"] + "*" + suffix
)
suffix_path = "/" + self.folder + "/*" + repodir.attrib["folder"] + "*" + suffix
repopath = self.ag.productpath + suffix_path if "/" in self.folder else self.ag.productrepopath() + suffix_path

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants