From d2dd3d0ac6339b8126d4a6264f0af18e60fe9a02 Mon Sep 17 00:00:00 2001 From: mdipierro Date: Sat, 24 Nov 2012 10:48:27 -0600 Subject: [PATCH] fixed issue 1179, welcome.w2p created if not exists --- VERSION | 2 +- gluon/fileutils.py | 11 +++++++++++ gluon/widget.py | 8 -------- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/VERSION b/VERSION index 698817fc..3fdc34f1 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -Version 2.2.1 (2012-11-24 10:35:09) stable +Version 2.2.1 (2012-11-24 10:47:44) stable diff --git a/gluon/fileutils.py b/gluon/fileutils.py index a19cc73b..d15152cd 100644 --- a/gluon/fileutils.py +++ b/gluon/fileutils.py @@ -241,6 +241,17 @@ def w2p_pack(filename, path, compiled=False): def w2p_unpack(filename, path, delete_tar=True): + + if filename=='welcome.w2p' and ( + not os.path.exists('welcome.w2p') or \ + os.path.exists('NEWINSTALL')): + try: + w2p_pack('welcome.w2p', 'applications/welcome') + os.unlink('NEWINSTALL') + except: + msg = "New installation: unable to create welcome.w2p file" + sys.stderr.write(msg) + filename = abspath(filename) path = abspath(path) if filename[-4:] == '.w2p' or filename[-3:] == '.gz': diff --git a/gluon/widget.py b/gluon/widget.py index 75e0d100..ce65cb43 100644 --- a/gluon/widget.py +++ b/gluon/widget.py @@ -975,14 +975,6 @@ def console(): if not os.path.exists('applications/__init__.py'): write_file('applications/__init__.py', '') - if not os.path.exists('welcome.w2p') or os.path.exists('NEWINSTALL'): - try: - w2p_pack('welcome.w2p', 'applications/welcome') - os.unlink('NEWINSTALL') - except: - msg = "New installation: unable to create welcome.w2p file" - sys.stderr.write(msg) - return (options, args)