fixed issue 1225, NEWINSTALL ignored

This commit is contained in:
mdipierro
2012-12-17 08:46:33 -06:00
parent 0207a17afa
commit e7d14c028b
3 changed files with 14 additions and 10 deletions
+10 -8
View File
@@ -15,6 +15,7 @@ import tarfile
import glob
import time
import datetime
import logging
from http import HTTP
from gzip import open as gzopen
@@ -240,19 +241,20 @@ def w2p_pack(filename, path, compiled=False):
tarfp.close()
os.unlink(tarname)
def w2p_unpack(filename, path, delete_tar=True):
if filename=='welcome.w2p' and (
not os.path.exists('welcome.w2p') or \
os.path.exists('NEWINSTALL')):
def create_welcome_w2p():
if not os.path.exists('welcome.w2p') or os.path.exists('NEWINSTALL'):
try:
w2p_pack('welcome.w2p', 'applications/welcome')
os.unlink('NEWINSTALL')
logging.info("New installation: created welcome.w2p file")
except:
msg = "New installation: unable to create welcome.w2p file"
sys.stderr.write(msg)
logging.error("New installation error: unable to create welcome.w2p file")
def w2p_unpack(filename, path, delete_tar=True):
if filename=='welcome.w2p':
create_welcome_w2p()
filename = abspath(filename)
path = abspath(path)
if filename[-4:] == '.w2p' or filename[-3:] == '.gz':