Added mainprefix and prefix variables

Fixed prefix variable values
This commit is contained in:
jonpas 2015-05-22 19:51:06 +02:00
parent 9536423f2e
commit 02580d510d

View File

@ -4,6 +4,10 @@ import os
import sys import sys
import subprocess import subprocess
######## GLOBALS #########
mainprefix = "z"
prefix = "ace_"
##########################
def mod_time(path): def mod_time(path):
if not os.path.isdir(path): if not os.path.isdir(path):
@ -15,12 +19,12 @@ def mod_time(path):
def check_for_changes(addonspath, module): def check_for_changes(addonspath, module):
if not os.path.exists(os.path.join(addonspath, "ace_{}.pbo".format(module))): if not os.path.exists(os.path.join(addonspath, prefix + module + ".pbo")):
return True return True
return mod_time(os.path.join(addonspath, module)) > mod_time(os.path.join(addonspath, "ace_{}.pbo".format(module))) return mod_time(os.path.join(addonspath, module)) > mod_time(os.path.join(addonspath, prefix + module + ".pbo"))
def check_for_obsolete_pbos(addonspath, file): def check_for_obsolete_pbos(addonspath, file):
module = file[4:-4] module = file[len(prefix):-4]
if not os.path.exists(os.path.join(addonspath, module)): if not os.path.exists(os.path.join(addonspath, module)):
return True return True
return False return False
@ -68,9 +72,9 @@ def main():
subprocess.check_output([ subprocess.check_output([
"makepbo", "makepbo",
"-NUP", "-NUP",
"-@=z\\addons\\ace\\{}".format(p), "-@={}\\addons\\{}\\".format(mainprefix, prefix.rstrip("_")) + p,
p, p,
"ace_{}.pbo".format(p) prefix + p + ".pbo"
], stderr=subprocess.STDOUT) ], stderr=subprocess.STDOUT)
except: except:
failed += 1 failed += 1