diff options
author | Sin Nombre <sin@ubuntu.(none)> | 2010-05-28 20:45:29 (GMT) |
---|---|---|
committer | Sin Nombre <sin@ubuntu.(none)> | 2010-05-28 20:45:29 (GMT) |
commit | 9e93d1b9802385900b6f833f81f84c0ac50f91ef (patch) | |
tree | f2c16599bde31b31e5d44bae4a87e7e4093f3cab /olpcgames/buildmanifest.py | |
parent | ac8cbb6691ba3de1c7c42f4362edbe11270f4506 (diff) |
Diffstat (limited to 'olpcgames/buildmanifest.py')
-rwxr-xr-x | olpcgames/buildmanifest.py | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/olpcgames/buildmanifest.py b/olpcgames/buildmanifest.py new file mode 100755 index 0000000..899433b --- /dev/null +++ b/olpcgames/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() |