diff --git a/scripts/build.py b/scripts/build.py index d43aa6f99..17911d848 100644 --- a/scripts/build.py +++ b/scripts/build.py @@ -9,6 +9,7 @@ elif sys.version_info[0] == 3: match = re.search('(.*)/', sys.argv[0]) if match != None: os.chdir(match.group(1)) +os.chdir('../') url_bam = "http://github.com/matricks/bam/zipball/master" url_teeworlds = "http://github.com/oy/teeworlds/zipball/master" @@ -76,7 +77,7 @@ else: print("%s-%s-%s" % (name, version_teeworlds, platform)) root_dir = os.getcwd() + os.sep -work_dir = root_dir + "work" +work_dir = root_dir + "scripts/work" def fetch_file(url): try: @@ -128,7 +129,7 @@ def bail(reason): def clean(): print("*** cleaning ***") - try: shutil.rmtree("work") + try: shutil.rmtree(work_dir) except: pass def file_exists(file): @@ -150,7 +151,7 @@ if flag_clean: clean() # make dir -try: os.mkdir("work") +try: os.mkdir(work_dir) except: pass # change dir diff --git a/scripts/copyright.py b/scripts/copyright.py index fade0b139..269ac7a3d 100755 --- a/scripts/copyright.py +++ b/scripts/copyright.py @@ -2,9 +2,10 @@ import os, re, sys match = re.search('(.*)/', sys.argv[0]) if match != None: os.chdir(match.group(1)) +os.chdir('../') notice = [b"/* (c) Magnus Auvinen. See licence.txt in the root of the distribution for more information. */\n", b"/* If you are missing that file, acquire a complete release at teeworlds.com. */\n"] -exclude = ["../src%sengine%sexternal" % (os.sep, os.sep), "../src%sosxlaunch" % os.sep] +exclude = ["src%sengine%sexternal" % (os.sep, os.sep), "src%sosxlaunch" % os.sep] updated_files = 0 def fix_copyright_notice(filename): @@ -42,7 +43,7 @@ def fix_copyright_notice(filename): updated_files += 1 skip = False -for root, dirs, files in os.walk("../src"): +for root, dirs, files in os.walk("src"): for excluding in exclude: if root[:len(excluding)] == excluding: skip = True diff --git a/scripts/update_localization.py b/scripts/update_localization.py index bb80d8b2e..08c1866e2 100644 --- a/scripts/update_localization.py +++ b/scripts/update_localization.py @@ -2,6 +2,7 @@ import os, re, sys match = re.search('(.*)/', sys.argv[0]) if match != None: os.chdir(match.group(1)) +os.chdir('../') source_exts = [".c", ".cpp", ".h"] @@ -13,7 +14,7 @@ def parse_source(): stringtable[fields[0]] = "" process_line(fields[1]) - for root, dirs, files in os.walk("../src"): + for root, dirs, files in os.walk("src"): for name in files: filename = os.path.join(root, name) @@ -80,11 +81,11 @@ srctable = parse_source() print("%-40s %8s %8s %8s" % ("filename", "total", "new", "old")) -for filename in os.listdir("../data/languages"): +for filename in os.listdir("data/languages"): if not ".txt" in filename: continue if filename == "index.txt": continue - filename = "../data/languages/" + filename + filename = "data/languages/" + filename generate_languagefile(filename, srctable, load_languagefile(filename))