mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Added mainprefix and prefix variables
Fixed prefix variable values
This commit is contained in:
parent
9536423f2e
commit
02580d510d
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user