Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/olpcgamesbridge/buildmanifest.py
diff options
context:
space:
mode:
authorToaster <toastertaster@gmail.com>2012-07-08 06:22:40 (GMT)
committer Toaster <toastertaster@gmail.com>2012-07-08 06:22:40 (GMT)
commit506267c9e19d94aba999c56d82ef856954b66998 (patch)
tree4ca763353999480b8208a81742613dbc474b1b4b /olpcgamesbridge/buildmanifest.py
parentd471a8c2eab0cc64a87a09cf386eeb653faf8292 (diff)
Moving directory (at least temporarily)
Diffstat (limited to 'olpcgamesbridge/buildmanifest.py')
-rwxr-xr-xolpcgamesbridge/buildmanifest.py33
1 files changed, 33 insertions, 0 deletions
diff --git a/olpcgamesbridge/buildmanifest.py b/olpcgamesbridge/buildmanifest.py
new file mode 100755
index 0000000..899433b
--- /dev/null
+++ b/olpcgamesbridge/buildmanifest.py
@@ -0,0 +1,33 @@
+#! /usr/bin/env python
+"""Stupid little script to automate generation of MANIFEST and po/POTFILES.in
+
+Really this should have been handled by using distutils, but oh well,
+distutils is a hoary beast and I can't fault people for not wanting to
+spend days spelunking around inside it to find the solutions...
+"""
+from distutils.filelist import FileList
+import os
+
+def fileList( template ):
+ """Produce a formatted file-list for storing in a file"""
+ files = FileList()
+ for line in filter(None,template.splitlines()):
+ files.process_template_line( line )
+ content = '\n'.join( files.files )
+ return content
+
+
+def main( ):
+ """Do the quicky finding of files for our manifests"""
+ content = fileList( open('MANIFEST.in').read() )
+ open( 'MANIFEST','w').write( content )
+
+ content = fileList( open('POTFILES.in').read() )
+ try:
+ os.makedirs( 'po' )
+ except OSError, err:
+ pass
+ open( os.path.join('po','POTFILES.in'), 'w').write( content )
+
+if __name__ == "__main__":
+ main()