changeset 162:47392bf3fcba

clean ups and fixes
author casties
date Thu, 06 Jun 2013 19:13:07 +0200
parents 2b5adc7f5445
children ed1366e3c533
files MPIWGHelper.py MPIWGProjects.py MPIWGRoot.py MPIWGStaff.py
diffstat 4 files changed, 28 insertions(+), 24 deletions(-) [+]
line wrap: on
line diff
--- 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:
--- 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:]
--- 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+"</body></html>"
                      
 
--- 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):