Set the root directory of teeworlds as the main directory for scripts

This commit is contained in:
Sworddragon 2011-05-06 18:27:06 +02:00 committed by oy
parent 1850851a47
commit baa2e650a5
3 changed files with 11 additions and 8 deletions

View file

@ -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

View file

@ -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

View file

@ -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))