Skip to content

Instantly share code, notes, and snippets.

@koo5
Created April 10, 2012 18:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save koo5/2353361 to your computer and use it in GitHub Desktop.
Save koo5/2353361 to your computer and use it in GitHub Desktop.
git friendly inform7 project skeleton
#!/usr/bin/python
from os import symlink, chdir, getcwd, mkdir, path
#a little tool to explode a git clone into a full inform project
class folder:
def __init__(self, name):
self.d = name
if not path.exists(self.d):
print "making "+self.d
mkdir(self.d)
def __enter__(self):
chdir(self.d)
return self
def __exit__(self, type, value, traceback):
chdir('..')
def link(dst):
if not path.lexists(dst):
print "linking "+dst
head,tail = path.split(dst)
if tail == dst:
prefix = '../'
else:
prefix = '../../'
symlink(prefix+path.basename(dst),dst)
#supposing we are running in the project base directory
projectname = path.basename(getcwd())
print "my name is "+projectname+' #supposing we are running in the project base directory'
with folder(projectname+".inform"):
folder("Build")
folder("Index")
folder("Source")
link("Settings.plist")
open("uuid.txt", "w").write("f00df00d-f00d-f00d-f00d-f00df00df00d")
link("Source/story.ni")
link("Build/output.ulx")
open("Build/Debug log.txt", 'a')
open("Index/Headings.xml", 'a')
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.
com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IFCompilerOptions</key>
<dict>
<key>IFSettingNaturalInform</key>
<true/>
</dict>
<key>IFInform6Extensions</key>
<dict/>
<key>IFLibrarySettings</key>
<dict>
<key>IFSettingLibraryToUse</key>
<string>Natural</string>
</dict>
<key>IFMiscSettings</key>
<dict>
<key>IFSettingInfix</key>
<false/>
</dict>
<key>IFOutputSettings</key>
<dict>
<key>IFSettingCreateBlorb</key>
<false/>
<key>IFSettingZCodeVersion</key>
<integer>256</integer>
</dict>
</dict>
</plist>
"story" by author.
room1 is a room;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment