Back to index

plone3  3.1.7
zserverPatch.py
Go to the documentation of this file.
00001 try:
00002     import ZServer
00003     zserver = 1
00004 except:
00005     # deal gracefully with the case of no ZServer (i.e. python is accessing
00006     # the ZODB directly)
00007     zserver = 0
00008 
00009 if zserver:
00010     from ZServer import zhttp_server
00011     from App.Common import package_home
00012     from Products.CMFPlone import cmfplone_globals
00013     from ZServer import ZOPE_VERSION, ZSERVER_VERSION
00014 
00015     from os.path import join
00016 
00017     try:
00018         file = join(package_home(cmfplone_globals), 'version.txt')
00019         PLONE_VERSION = open(file, 'r').read().strip()
00020     except IOError:
00021         PLONE_VERSION = 'Unknown'
00022 
00023     zhttp_server.SERVER_IDENT = 'Zope/%s ZServer/%s Plone/%s' % (
00024         ZOPE_VERSION,
00025         ZSERVER_VERSION,
00026         PLONE_VERSION
00027         )