Esempio n. 1
0
def construct_rule_path(output, book, section, path):
    full = "/".join([char_replace(p) for p in path])
    typedir = os.path.abspath(output + "/" + char_replace(book) + "/" + full)
    if not os.path.exists(typedir):
        os.makedirs(typedir)
    typefile = typedir + "/" + char_replace(section["name"]) + ".json"
    if os.path.exists(typefile):
        sys.stderr.write("File %s already exists\n" % typefile)
        # raise Exception("File %s already exists" % typefile)
    return typefile
Esempio n. 2
0
def construct_rule_path(output, book, section, path):
    full = "/".join([char_replace(p) for p in path])
    typedir = os.path.abspath(output + "/" + char_replace(book) + "/" + full)
    if not os.path.exists(typedir):
        os.makedirs(typedir)
    typefile = typedir + "/" + char_replace(section['name']) + ".json"
    if os.path.exists(typefile):
        sys.stderr.write("File %s already exists\n" % typefile)
        #raise Exception("File %s already exists" % typefile)
    return typefile
Esempio n. 3
0
def construct_type_path(output, book, section):
    typedir = os.path.abspath(output + "/" + char_replace(book) + "/" + char_replace(section["type"]))
    if section.has_key("subtype"):
        typedir += "/" + section["subtype"]
        if not os.path.exists(typedir):
            os.makedirs(typedir)
    typefile = typedir + "/" + char_replace(section["name"]) + ".json"
    if os.path.exists(typefile):
        sys.stderr.write("File %s already exists\n" % typefile)
        # raise Exception("File %s already exists" % typefile)
    return typefile
Esempio n. 4
0
def construct_type_path(output, book, section):
    typedir = os.path.abspath(output + "/" + char_replace(book) + "/" +
                              char_replace(section['type']))
    if section.has_key('subtype'):
        typedir += "/" + section['subtype']
        if not os.path.exists(typedir):
            os.makedirs(typedir)
    typefile = typedir + "/" + char_replace(section['name']) + ".json"
    if os.path.exists(typefile):
        sys.stderr.write("File %s already exists\n" % typefile)
        #raise Exception("File %s already exists" % typefile)
    return typefile
Esempio n. 5
0
def create_skill_filename(output, book, skill):
    title = char_replace(book) + "/skills/" + char_replace(skill["name"])
    return os.path.abspath(output + "/" + title + ".json")
Esempio n. 6
0
def create_race_filename(output, book, race):
	title = char_replace(book) + "/races/" + char_replace(race['name'])
	return os.path.abspath(output + "/" + title + ".json")
Esempio n. 7
0
def create_spell_list_filename(output, book, spell_list):
	title = char_replace(book) + "/spell_lists/" + char_replace(spell_list['class']) + "-" + unicode(spell_list['level'])
	return os.path.abspath(output + "/" + title + ".json")
Esempio n. 8
0
def create_class_filename(output, book, cl):
	title = char_replace(book) + "/classes/" + char_replace(cl['name'])
	return os.path.abspath(output + "/" + title + ".json")
Esempio n. 9
0
def create_feat_filename(output, book, feat):
    title = char_replace(book) + "/feats/" + char_replace(feat['name'])
    return os.path.abspath(output + "/" + title + ".json")
Esempio n. 10
0
def create_creature_filename(output, book, creature):
	title = char_replace(book) + "/creatures/" + char_replace(creature['name'])
	return os.path.abspath(output + "/" + title + ".json")
Esempio n. 11
0
def create_class_filename(output, book, cl):
    title = char_replace(book) + "/classes/" + char_replace(cl['name'])
    return os.path.abspath(output + "/" + title + ".json")
Esempio n. 12
0
def create_spell_filename(output, book, spell):
	title = char_replace(book) + "/spells/" + char_replace(spell['name'])
	return os.path.abspath(output + "/" + title + ".json")
Esempio n. 13
0
def create_rules_filename(output, book, filename):
	title = char_replace(book) + "/rules/" + char_replace(filename)
	return os.path.abspath(output + "/" + title + ".json")
Esempio n. 14
0
def create_spell_filename(output, book, spell):
	title = char_replace(book) + "/spells/" + char_replace(spell['name'])
	return os.path.abspath(output + "/" + title + ".json")
Esempio n. 15
0
def create_spell_list_filename(output, book, spell_list):
	title = char_replace(book) + "/spell_lists/" + char_replace(spell_list['class']) + "-" + unicode(spell_list['level'])
	return os.path.abspath(output + "/" + title + ".json")
Esempio n. 16
0
def create_race_filename(output, book, race):
    title = char_replace(book) + "/races/" + char_replace(race['name'])
    return os.path.abspath(output + "/" + title + ".json")
Esempio n. 17
0
def generate_extension_output_file_name(output_dir, book, fn):
	return os.path.join(
		os.path.abspath(output_dir),
		char_replace(book),
		'extensions',
		fn)
Esempio n. 18
0
def create_feat_filename(output, book, feat):
	title = char_replace(book) + "/feats/" + char_replace(feat['name'])
	return os.path.abspath(output + "/" + title + ".json")
Esempio n. 19
0
def generate_extension_file_name(output_dir, book):
    return os.path.join(os.path.abspath(output_dir), char_replace(book),
                        'extension.json')
Esempio n. 20
0
def create_rules_filename(output, book, filename):
    title = char_replace(book) + "/rules/" + char_replace(filename)
    return os.path.abspath(output + "/" + title + ".json")
Esempio n. 21
0
def create_creature_filename(output, book, creature):
    title = char_replace(book) + "/creatures/" + char_replace(creature['name'])
    return os.path.abspath(output + "/" + title + ".json")