Various minor bugfixes.

This commit is contained in:
Gaetan Delannay 2010-01-20 21:51:17 +01:00
parent 24c0dee96c
commit 3bb907ca5d
4 changed files with 24 additions and 8 deletions

View file

@ -453,6 +453,7 @@ class Publisher:
f.write(toc)
f.close()
privateScripts = ('publish.py', 'zip.py', 'runOpenOffice.sh')
def prepareGenFolder(self):
'''Creates the basic structure of the temp folder where the appy
website will be generated.'''
@ -466,9 +467,12 @@ class Publisher:
os.mkdir(genSrcFolder)
for aFile in ('__init__.py',):
shutil.copy('%s/%s' % (appyPath, aFile), genSrcFolder)
for aFolder in ('gen', 'pod', 'shared'):
for aFolder in ('gen', 'pod', 'shared', 'bin'):
shutil.copytree('%s/%s' % (appyPath, aFolder),
'%s/%s' % (genSrcFolder, aFolder))
# Remove some scripts from bin
for script in self.privateScripts:
os.remove('%s/bin/%s' % (genSrcFolder, script))
# Write the appy version into the code itself (in appy/version.py)'''
print 'Publishing version %s...' % self.versionShort
# Dump version info in appy/version.py

View file

@ -162,7 +162,7 @@ class FlavourMixin(AbstractMixin):
elems = []
importPath = getattr(self, 'importPathFor%s' % contentType)
for elem in os.listdir(importPath):
elemFullPath = os.path.join(importParams['path'], elem)
elemFullPath = os.path.join(importPath, elem)
elemInfo = onElement(elemFullPath)
if elemInfo:
elemInfo.insert(0, elemFullPath) # To the result, I add the full

View file

@ -648,11 +648,18 @@ class ToolMixin(AbstractMixin):
res[urlKey] = None
if needIt:
exec 'index = %sIndex' % urlType
brain = self.uid_catalog(UID=uids[index])
uid = None
try:
uid = uids[index]
# uids can be a list (ref) or a dict (search)
except KeyError: pass
except IndexError: pass
if uid:
brain = self.uid_catalog(UID=uid)
if brain:
baseUrl = brain[0].getObject().getUrl()
navUrl = baseUrl + '/?nav=' + newNav % (index + 1)
res['%sUrl' % urlType] = navUrl
res[urlKey] = navUrl
return res
def tabularize(self, data, numberOfRows):

View file

@ -76,6 +76,11 @@ class AbstractMixin:
rq.SESSION['initiatorField'] = rq.get('field')
rq.SESSION['initiatorTarget'] = rq.get('type_name')
if self._appy_meta_type == 'tool':
if rq.get('initiator', None):
# This is the creation of an object linked to the tool
baseUrl = self.absolute_url()
else:
# This is the creation of a root object in the app folder
baseUrl = self.getAppFolder().absolute_url()
else:
baseUrl = self.absolute_url()