Extract PATH_7Z variable

pull/446/head
Jason Cobb 2 years ago
parent 40fc38722d
commit 443d0fedd5

@ -26,6 +26,8 @@ import time
from .dumpgenerator.domain import domain2prefix
def main():
PATH_7Z = "7z"
if len(sys.argv) < 2:
print("python script.py file-with-apis.txt")
sys.exit()
@ -59,7 +61,7 @@ def main():
if ((sys.version_info[0] == 3) and (sys.version_info[1] > 0)) or (
(sys.version_info[0] == 2) and (sys.version_info[1] > 6)
):
archivecontent = subprocess.check_output(["7z", "l", zipfilename])
archivecontent = subprocess.check_output([PATH_7Z, "l", zipfilename])
if re.search(r"%s.+-history\.xml" % (prefix), archivecontent) is None:
# We should perhaps not create an archive in this case, but we continue anyway.
print("ERROR: The archive contains no history!")
@ -154,7 +156,7 @@ def main():
)
# Make a non-solid archive with all the text and metadata at default compression. You can also add config.txt if you don't care about your computer and user names being published or you don't use full paths so that they're not stored in it.
compressed = subprocess.call(
"7z"
PATH_7Z
+ " a -ms=off ../%s-history.xml.7z.tmp %s-history.xml %s-titles.txt index.html Special:Version.html errors.log siteinfo.json"
% (prefix, prefix, prefix),
shell=True,
@ -175,7 +177,7 @@ def main():
shell=True,
)
subprocess.call(
"7z"
PATH_7Z
+ " a -ms=off -mx=1 ../%s-wikidump.7z.tmp %s-images.txt images/"
% (prefix, prefix),
shell=True,

Loading…
Cancel
Save