mirror of
https://github.com/HamletDuFromage/switch-cheats-db.git
synced 2025-04-24 08:25:17 +00:00
cause everytime we touch, I feel the power
This commit is contained in:
parent
b1425c9d3a
commit
cb14ec6691
@ -113,20 +113,24 @@ class ArchiveWorker():
|
|||||||
attribution_file.write(content)
|
attribution_file.write(content)
|
||||||
else:
|
else:
|
||||||
cheats = ""
|
cheats = ""
|
||||||
for cheat, content in value.items():
|
for _, content in value.items():
|
||||||
cheats += content
|
cheats += content
|
||||||
if cheats:
|
if cheats:
|
||||||
with open(tid_path.joinpath(f"{key}.txt"), "w") as bid_file:
|
with open(tid_path.joinpath(f"{key}.txt"), "w") as bid_file:
|
||||||
bid_file.write(cheats)
|
bid_file.write(cheats)
|
||||||
|
|
||||||
def create_archives(self, out_path, quantifier=""):
|
def touch_all(self, path):
|
||||||
|
for path in path.rglob("*"):
|
||||||
|
if path.is_file():
|
||||||
|
path.touch()
|
||||||
|
|
||||||
|
def create_archives(self, out_path):
|
||||||
out_path = Path(out_path)
|
out_path = Path(out_path)
|
||||||
titles_path = out_path.joinpath("titles")
|
titles_path = out_path.joinpath("titles")
|
||||||
if quantifier:
|
self.touch_all(titles_path)
|
||||||
quantifier = f"({quantifier})"
|
|
||||||
shutil.make_archive(str(titles_path.resolve()), "zip", root_dir=out_path, base_dir="titles")
|
shutil.make_archive(str(titles_path.resolve()), "zip", root_dir=out_path, base_dir="titles")
|
||||||
titles_path
|
|
||||||
contents_path = titles_path.rename(titles_path.parent.joinpath("contents"))
|
contents_path = titles_path.rename(titles_path.parent.joinpath("contents"))
|
||||||
|
self.touch_all(contents_path)
|
||||||
shutil.make_archive(str(contents_path.resolve()), "zip", root_dir=out_path, base_dir="contents")
|
shutil.make_archive(str(contents_path.resolve()), "zip", root_dir=out_path, base_dir="contents")
|
||||||
|
|
||||||
def create_version_file(self, out_path="."):
|
def create_version_file(self, out_path="."):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user