Trimming more trailing spaces #783

This commit is contained in:
ViperMaul 2015-04-21 10:05:11 -07:00
parent ced0d3d576
commit e605a8dbca

View File

@ -293,9 +293,9 @@ def print_yellow(msg):
print(msg)
color("reset")
def copy_important_files(source_dir,destination_dir):
originalDir = os.getcwd()
importantFiles = ["mod.cpp",
"README.md",
@ -303,10 +303,10 @@ def copy_important_files(source_dir,destination_dir):
"LICENSE",
"logo_ace3_ca.paa"
]
print_yellow ("source_dir: " + source_dir)
print_yellow("destination_dir: " + destination_dir)
#copy importantFiles
try:
print_blue("\nSearching for important files in " + source_dir)
@ -316,16 +316,16 @@ def copy_important_files(source_dir,destination_dir):
except:
print_error("COPYING IMPORTANT FILES.")
raise
#copy all extension dlls
try:
os.chdir(os.path.join(source_dir))
print_blue("\nSearching for DLLs in " + os.getcwd())
filenames = glob.glob("*.dll")
if not filenames:
print ("Empty SET")
for dll in filenames:
print_green("Copying dll => " + os.path.join(source_dir,dll))
if os.path.isfile(dll):
@ -339,10 +339,10 @@ def copy_important_files(source_dir,destination_dir):
def copy_optionals_for_building(mod,pbos):
src_directories = os.listdir(optionals_root)
current_dir = os.getcwd()
print_blue("\nChecking Optionals folder...")
try:
#special server.pbo processing
files = glob.glob(os.path.join(release_dir, "@ace","optionals","*.pbo"))
for file in files:
@ -383,7 +383,7 @@ def copy_optionals_for_building(mod,pbos):
raise
finally:
os.chdir(current_dir)
def cleanup_optionals(mod,pbos):
print("")
try:
@ -393,9 +393,9 @@ def cleanup_optionals(mod,pbos):
destination = os.path.join(work_drive,dir_name)
else:
destination = os.path.join(module_root,dir_name)
print("Cleaning " + destination)
try:
file_name = "ace_{}.pbo".format(dir_name)
src_file_path = os.path.join(release_dir, "@ace","addons",file_name)
@ -407,7 +407,7 @@ def cleanup_optionals(mod,pbos):
print_error(file_name + " already exists")
continue
shutil.rmtree(destination)
except:
print_error("Cleaning Optionals Failed")
raise
@ -535,7 +535,7 @@ See the make.cfg file for additional build options.
global release_dir
global module_root_parent
global optionals_root
cfg.read(os.path.join(make_root, "make.cfg"))
# Project name (with @ symbol)
@ -569,7 +569,7 @@ See the make.cfg file for additional build options.
# Release/build directory, relative to script dir
release_dir = cfg.get(make_target, "release_dir", fallback="release")
# Project PBO file prefix (files are renamed to prefix_name.pbo)
pbo_name_prefix = cfg.get(make_target, "pbo_name_prefix", fallback=None)
@ -578,7 +578,7 @@ See the make.cfg file for additional build options.
module_root = cfg.get(make_target, "module_root", fallback=os.path.join(make_root_parent, "addons"))
optionals_root = os.path.join(module_root_parent, "optionals")
print_green ("module_root: " + module_root)
if (os.path.isdir(module_root)):
os.chdir(module_root)
else:
@ -590,9 +590,9 @@ See the make.cfg file for additional build options.
else:
print_error ("Directory " + optionals_root + " does not exist.")
sys.exit()
print_green ("release_dir: " + release_dir)
except:
raise
print_error("Could not parse make.cfg.")
@ -640,14 +640,14 @@ See the make.cfg file for additional build options.
print ("No cache found.")
cache = {}
#Temporarily copy optionals_root for building. They will be removed later.
#Temporarily copy optionals_root for building. They will be removed later.
optionals_modules = []
optional_files = []
copy_optionals_for_building(optionals_modules,optional_files)
# Get list of subdirs in make root.
dirs = next(os.walk(module_root))[1]
# Autodetect what directories to build.
if module_autodetect and not arg_modules:
modules = []
@ -692,7 +692,7 @@ See the make.cfg file for additional build options.
for module in modules:
print_green("\nMaking " + module + "-"*max(1, (60-len(module))))
missing = False
# Cache check
if module in cache:
old_sha = cache[module]
@ -705,7 +705,7 @@ See the make.cfg file for additional build options.
# Hash the module
new_sha = get_directory_hash(os.path.join(module_root, module))
# Is the pbo file missing?
missing = not os.path.isfile(os.path.join(release_dir, project, "addons", "ace_{}.pbo".format(module)))
if missing:
@ -789,7 +789,7 @@ See the make.cfg file for additional build options.
print_error("CfgConvert -txt return code == " + str(ret) + ". Usually means there is a syntax error within the config.cpp file.")
os.remove(os.path.join(work_drive, prefix, module, "config.cpp"))
shutil.copyfile(os.path.join(work_drive, prefix, module, "config.backup"), os.path.join(work_drive, prefix, module, "config.cpp"))
# Include build number
try:
@ -807,7 +807,7 @@ See the make.cfg file for additional build options.
f.close()
else:
os.remove(os.path.join(work_drive, prefix, module, "config.cpp"))
os.rename(os.path.join(work_drive, prefix, module, "config.backup"), os.path.join(work_drive, prefix, module, "config.cpp"))
os.rename(os.path.join(work_drive, prefix, module, "config.backup"), os.path.join(work_drive, prefix, module, "config.cpp"))
except:
raise
print_error("Failed to include build number")