# HG changeset patch # User casties # Date 1370538787 -7200 # Node ID 47392bf3fcbafbcae287b0ad95ee5712c362e351 # Parent 2b5adc7f5445a40f46af2e132746c546c54a2f90 clean ups and fixes diff -r 2b5adc7f5445 -r 47392bf3fcba MPIWGHelper.py --- a/MPIWGHelper.py Thu Jun 06 19:11:45 2013 +0200 +++ b/MPIWGHelper.py Thu Jun 06 19:13:07 2013 +0200 @@ -147,6 +147,15 @@ return subsec +def getPathStyle(self, path, selected, style=""): + """returns a string with the given style + 'sel' if path == selected.""" + if path == selected: + return style + 'sel' + else: + return style + + + def getUrl(self, baseUrl=None): """returns URL to this object""" if baseUrl is None: diff -r 2b5adc7f5445 -r 47392bf3fcba MPIWGProjects.py --- a/MPIWGProjects.py Thu Jun 06 19:11:45 2013 +0200 +++ b/MPIWGProjects.py Thu Jun 06 19:13:07 2013 +0200 @@ -472,7 +472,7 @@ # compat with old lists t = t[0] - if forSorting and t is not None: + if forSorting and t is not None and len(t) > 0: # remove stopwords and signs for sorting if t.lower().startswith('a '): t = t[2:] diff -r 2b5adc7f5445 -r 47392bf3fcba MPIWGRoot.py --- a/MPIWGRoot.py Thu Jun 06 19:11:45 2013 +0200 +++ b/MPIWGRoot.py Thu Jun 06 19:13:07 2013 +0200 @@ -9,10 +9,10 @@ from Products.ZSQLExtend.ZSQLExtend import ZSQLExtendFolder -from MPIWGHelper import * +import MPIWGHelper import updatePersonalWWW import MPIWGStaff -from SrvTxtUtils import getInt, getAt, utf8ify, refreshingImageFileIndexHtml, getDateString +from SrvTxtUtils import getInt, unicodify, refreshingImageFileIndexHtml, getDateString class MPIWGRoot(ZSQLExtendFolder): @@ -152,14 +152,9 @@ return items - def getPathStyle(self, path, selected, style=""): - """returns a string with the given style + 'sel' if path == selected.""" - if path == selected: - return style + 'sel' - else: - return style - - + getPathStyle = MPIWGHelper.getPathStyle + + def getFeatures(self, num=None): """returns a list of the last num Features""" dir = getattr(self, 'features', None) @@ -369,10 +364,10 @@ logging.debug("updatePersonEntry: data=%s ignoreEntries=%s"%(repr(data),repr(ignoreEntries))) if data['date_to']=="": # wenn date_to leer - data['date_to']="date_none" + data['date_to']="date_none" if data['date_from']=="": # wenn date_fromleer - data['date_from']="date_none" + data['date_from']="date_none" msg="" @@ -461,12 +456,12 @@ self.updatePersonEntry(resultSet[conflict],ignoreEntries=ignoreEntries) - # rest + # rest cl=list(conflicts.keys()) for key in resultSet.keys(): - if key not in cl: - self.updatePersonEntry(resultSet[key]) + if key not in cl: + self.updatePersonEntry(resultSet[key]) return ret+"" diff -r 2b5adc7f5445 -r 47392bf3fcba MPIWGStaff.py --- a/MPIWGStaff.py Thu Jun 06 19:11:45 2013 +0200 +++ b/MPIWGStaff.py Thu Jun 06 19:13:07 2013 +0200 @@ -385,21 +385,21 @@ def getLastUpdateCV(self): """getDate of Last Update""" try: - fname="%s_cv.pdf"%self.getUsername().encode('utf-8') - logging.debug(fname) - ob=self.folder._getOb("downloadableFiles")._getOb(fname) - return ob.bobobase_modification_time() + fname="%s_cv.pdf"%self.getUsername().encode('utf-8') + logging.debug(fname) + ob=self.folder._getOb("downloadableFiles")._getOb(fname) + return ob.bobobase_modification_time() except: - return "No file yet!" + return "No file yet!" def getLastUpdatePublications(self): """getDate of Last Update""" try: - ob=self.folder._getOb("downloadableFiles")._getOb("%s_publications.pdf"%self.getUsername().encode('utf-8')) - return ob.bobobase_modification_time() + ob=self.folder._getOb("downloadableFiles")._getOb("%s_publications.pdf"%self.getUsername().encode('utf-8')) + return ob.bobobase_modification_time() except: - return "No file yet!" + return "No file yet!" def downloadCV(self,REQUEST):