Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--desktopbuild.py25
-rw-r--r--xobuild.py24
2 files changed, 39 insertions, 10 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"
diff --git a/xobuild.py b/xobuild.py
index fd21c9c..8508bdc 100644
--- a/xobuild.py
+++ b/xobuild.py
@@ -21,9 +21,22 @@
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 zipfile
import info
+import logging
+bundle_name = 'dist/%s-%s.xo' % (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 +88,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.activity' % info.name.replace(' ', ''))
-xofile = zipfile.ZipFile('./%s-%s.xo' % (info.name.replace(' ', ''),
- info.version), 'w')
+xofile = zipfile.ZipFile(bundle_name, 'w')
for name, path in manifest:
xofile.write(name, path)
- print 'Packed %s as %s' % (name, path)
+ logger.info('Packed %s as %s' % (name, path))
xofile.close()
+
+logger.info('Closing log file')
+print "Closed log file"