Hi,
Warning, same missing folder zoneinfo with server in server\library.zip, but I don't know if zoneinfo is necessary for the server. But more than missing folder zoneinfo, the file reference.py is missing also.
If necessary, to add reference.py, add pytz in the list of required package in server\setup.py line 196 :
- "uuid",
+ "uuid", "pytz"
If necessary zoneinfo in server, add the code after in server\setup.py as in client
to add complete pytz library (with folder zoneinfo), like in client\setup.nsi in branch 5.0, add at the end of the script client\setup.py :
if has_py2exe:
# Sometime between pytz-2008a and pytz-2008i common_timezones started to
# include only names of zones with a corresponding data file in zoneinfo.
# pytz installs the zoneinfo directory tree in the same directory
# as the pytz/__init__.py file. These data files are loaded using
# pkg_resources.resource_stream. py2exe does not copy this to library.zip so
# resource_stream can't find the files and common_timezones is empty when
# read in the py2exe executable.
# This manually copies zoneinfo into the zip. See also
# http://code.google.com/p/googletransitdatafeed/issues/detail?id=121
import pytz
import zipfile
import tempfile
import shutil
# Make sure the layout of pytz hasn't changed
assert (pytz.__file__.endswith('__init__.pyc') or pytz.__file__.endswith('__init__.py')), pytz.__file__
temp_dir = None
pytz_dir = os.path.dirname(pytz.__file__)
zoneinfo_dir = os.path.join(pytz_dir, 'zoneinfo')
if not os.path.exists(zoneinfo_dir):
egg = os.path.dirname(pytz_dir)
Hi,
Warning, same missing folder zoneinfo with server in server\library.zip, but I don't know if zoneinfo is necessary for the server. But more than missing folder zoneinfo, the file reference.py is missing also.
If necessary, to add reference.py, add pytz in the list of required package in server\setup.py line 196 :
- "uuid",
+ "uuid", "pytz"
If necessary zoneinfo in server, add the code after in server\setup.py as in client
to add complete pytz library (with folder zoneinfo), like in client\setup.nsi in branch 5.0, add at the end of the script client\setup.py :
if has_py2exe: resource_ stream. py2exe does not copy this to library.zip so code.google. com/p/googletra nsitdatafeed/ issues/ detail? id=121 _file__ .endswith( '__init_ _.pyc') or
pytz. __file_ _.endswith( '__init_ _.py')) , pytz.__file__
# Sometime between pytz-2008a and pytz-2008i common_timezones started to
# include only names of zones with a corresponding data file in zoneinfo.
# pytz installs the zoneinfo directory tree in the same directory
# as the pytz/__init__.py file. These data files are loaded using
# pkg_resources.
# resource_stream can't find the files and common_timezones is empty when
# read in the py2exe executable.
# This manually copies zoneinfo into the zip. See also
# http://
import pytz
import zipfile
import tempfile
import shutil
# Make sure the layout of pytz hasn't changed
assert (pytz._
temp_dir = None dirname( pytz.__ file__) join(pytz_ dir, 'zoneinfo') exists( zoneinfo_ dir): dirname( pytz_dir)
pytz_dir = os.path.
zoneinfo_dir = os.path.
if not os.path.
egg = os.path.
if zipfile. is_zipfile( egg):
temp_ dir = tempfile.mkdtemp()
zoneinfo_ dir = os.path. join(temp_ dir, 'pytz', 'zoneinfo')
os. makedirs( zoneinfo_ dir)
archive = zipfile. ZipFile( egg) startswith( 'pytz/zoneinfo/ '):
file_ path = os.path. join(temp_ dir, filename)
destinati on = file_path. replace( '/', os.sep)
if not file_path. endswith( '/'):
try:
os.makedirs( os.path. dirname( destination) )
except os.error:
pass
fp = file(destination, 'w')
fp.write( archive. read(filename) )
fp.close( )
archive. close()
for filename in archive.namelist():
if filename.
# '..\\Lib\ \pytz\\ __init_ _.py' -> '..\\Lib' dirname( os.path. dirname( zoneinfo_ dir)) join(options[ 'py2exe' ]['dist_ dir'], 'library.zip') ZipFile( zipfile_ path, 'a') zoneinfo_ dir): len(disk_ basedir) :]
z. write(os. path.join( absdir, f), os.path. join(zip_ dir, f))
disk_basedir = os.path.
zipfile_path = os.path.
z = zipfile.
for absdir, directories, filenames in os.walk(
zip_dir = absdir[
for f in filenames:
z.close()
if temp_dir is not None:
shutil. rmtree( temp_dir)
Bye