22 from filelist
import filelist
23 from optparse
import OptionParser
24 parser = OptionParser()
25 parser.add_option(
"--local-copy",dest=
"local_copy",help=
"puts a copy of generated files in a templates/guild/<guildname>",default=
False,action=
"store_true")
26 parser.add_option(
"--no-install-copy",dest=
"install_copy",help=
"installs a remote copy to the destination directory. If false, only configures the files for installation.",default=
True,action=
"store_false")
27 (options, args) = parser.parse_args(sys.argv)
32 local_copy = options.local_copy
39 ExitX,ExitY=args[5],args[6]
44 StorageX,StorageY=args[8],args[9]
45 GuildName =
' '.join(args[10:])
48 os.system(
'mkdir '+ToGuild)
52 filecontents=fromfile.read()
54 filecontents=filecontents.replace(
'GUILD_TEMPLATE', ToGuild)
56 filecontents=filecontents.replace(
"region Template",
"region "+ToRegion).
replace(
"TemplateExit", ExitPath).
replace(
"TemplateHP", ExitX).
replace(
"TemplateSP", ExitY).
replace(
"Exit+1X", StorageX).
replace(
"ExitY",StorageY).
replace(
"ExitX",StorageX).
replace(
"ExitPath",StorageExit)
57 filecontents=filecontents.replace(
"[Template]",GuildName)
60 tofile=
open(
'./'+ToGuild+
'/'+i,
'w')
61 tofile.write(filecontents)
65 secondtofile=
open(
'../../'+ToFolder+
"/"+i,
'w')
66 secondtofile.write(filecontents)