fixed issue 1225, NEWINSTALL ignored
This commit is contained in:
+10
-8
@@ -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':
|
||||
|
||||
Reference in New Issue
Block a user