Minor updates.

This commit is contained in:
Gaetan Delannay 2012-02-27 14:06:39 +01:00
parent 13f3400577
commit 6d0549e6ce
3 changed files with 8 additions and 9 deletions

View file

@ -6,7 +6,7 @@
import os, os.path, sys, shutil, re
from optparse import OptionParser
from appy.shared.utils import cleanFolder, copyFolder
from appy.shared.packaging import ooStartSh, zopeConf
from appy.shared.packaging import ooStart, zopeConf
# ------------------------------------------------------------------------------
class NewError(Exception): pass
@ -114,7 +114,7 @@ class ZopeInstanceCreator:
os.chmod('bin/runzope', 0744) # Make it executable by owner.
# Create bin/startoo
f = file('bin/startoo', 'w')
f.write(ooStartSh)
f.write(ooStart)
f.close()
os.chmod('bin/startoo', 0744) # Make it executable by owner.
# Create etc/zope.conf

View file

@ -2150,7 +2150,7 @@ class Pod(Type):
tempFileName = '%s/%s_%f.%s' % (
getOsTempFolder(), obj.uid, time.time(), outputFormat)
# Define parameters to give to the appy.pod renderer
podContext = {'tool': tool, 'user': obj.user, 'self': obj,
podContext = {'tool': tool, 'user': obj.user, 'self': obj, 'field':self,
'now': obj.o.getProductConfig().DateTime(),
'_': obj.translate, 'projectFolder': tool.getDiskFolder()}
# If the POD document is related to a query, get it from the request,

View file

@ -24,9 +24,8 @@ ZopeRunner().run()
appRun = '''#! /bin/sh
exec "/usr/lib/zope2.12/bin/runzope" -C "/etc/%s.conf" "$@"
'''
ooStart = 'soffice -invisible -headless -nofirststartwizard ' \
ooStart = '#! /bin/sh\nsoffice -invisible -headless -nofirststartwizard ' \
'"-accept=socket,host=localhost,port=2002;urp;"'
ooStartSh = '#! /bin/sh\n%s\n' % ooStart
zopeConf = '''# Zope configuration.
%%define INSTANCE %s
%%define DATA %s
@ -80,7 +79,7 @@ initScript = '''#! /bin/sh
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start %s
# Description: Start the Zope and Appy-based %s application.
# Description: %s
### END INIT INFO
case "$1" in
@ -172,7 +171,7 @@ class Debianizer:
# startoo
name = '%s/startoo' % binFolder
f = file(name, 'w')
f.write(ooStartSh)
f.write(ooStart)
f.close()
os.chmod(name, 0744) # Make it executable by owner.
# /var/lib/<app> (will store Data.fs, lock files, etc)
@ -205,7 +204,7 @@ class Debianizer:
name = '%s/%s' % (initdFolder, self.appNameLower)
f = file(name, 'w')
n = self.appNameLower
f.write(initScript % (n, n, 'Start the Zope and Appy-based %s ' \
f.write(initScript % (n, n, 'Start Zope with the Appy-based %s ' \
'application.' % n, '%sctl start' % n,
'%sctl restart' % n, '%sctl stop' % n))
f.close()
@ -214,7 +213,7 @@ class Debianizer:
name = '%s/oo' % initdFolder
f = file(name, 'w')
f.write(initScript % ('oo', 'oo', 'Start OpenOffice in server mode',
ooStart, ooStart, "#Can't stop OO."))
'startoo', 'startoo', "#Can't stop OO."))
f.close()
os.chmod(name, 0744) # Make it executable by owner.
# Get the size of the app, in Kb.