diff --git a/bin/new.py b/bin/new.py index 749a04a..6453d7b 100644 --- a/bin/new.py +++ b/bin/new.py @@ -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 diff --git a/gen/__init__.py b/gen/__init__.py index b4c4711..e84af8f 100644 --- a/gen/__init__.py +++ b/gen/__init__.py @@ -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, diff --git a/shared/packaging.py b/shared/packaging.py index c58bc31..8b796bd 100644 --- a/shared/packaging.py +++ b/shared/packaging.py @@ -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/ (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.