diff options
Diffstat (limited to 'desktopbuild.py')
-rw-r--r-- | desktopbuild.py | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/desktopbuild.py b/desktopbuild.py index 1692020..2ea7edd 100644 --- a/desktopbuild.py +++ b/desktopbuild.py @@ -21,9 +21,23 @@ import sys import os sys.path.append(os.path.abspath('.')) +if not os.path.exists('./dist'): + os.mkdir('./dist') os.environ['INFO_L10N'] = '0' import tarfile import info +import logging +bundle_name = 'dist/%s-%s.tar.gz' % (info.name.replace(' ', ''), info.version) +log_file = '%s.log' % bundle_name +if os.path.exists(log_file): + os.remove(log_file) +logging.basicConfig(filename=log_file, level=logging.DEBUG) +print "Started log in %s" % log_file +logger = logging.getLogger('xo-bundler') +import time + +logger.debug('Log started on %s' % time.strftime('%c')) + ignore_ends = ['.pyc', '~', @@ -75,17 +89,18 @@ def packdir(path, newpath=None): else: new_path = list(os.path.split(filename)) if newpath: - global new_path if newpath != '.': new_path[0] = newpath manifest.append((filename, '/'.join(new_path))) - print '%s listed to pack' % filename + logger.info('%s listed to pack' % filename) packdir('./', '%s-%s' % (info.lower_name, info.version)) -tar = tarfile.open('./%s-%s.tgz' % (info.lower_name, - info.version), 'w:gz') +tar = tarfile.open(bundle_name, 'w:gz') for name, path in manifest: tar.add(name, path) - print 'Packed %s as %s' % (name, path) + logger.info('Packed %s as %s' % (name, path)) tar.close() + +logger.info('Closing log file') +print "Closed log file" |