[Erp5-report] r17882 - in /erp5/trunk/products/ERP5Form: ListBox.py SelectionTool.py

nobody at svn.erp5.org nobody at svn.erp5.org
Wed Nov 28 18:51:35 CET 2007


Author: kazuhiko
Date: Wed Nov 28 18:51:34 2007
New Revision: 17882

URL: http://svn.erp5.org?rev=17882&view=rev
Log:
remove needless imports and make cosmetic cleanup.

Modified:
    erp5/trunk/products/ERP5Form/ListBox.py
    erp5/trunk/products/ERP5Form/SelectionTool.py

Modified: erp5/trunk/products/ERP5Form/ListBox.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Form/ListBox.py?rev=17882&r1=17881&r2=17882&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Form/ListBox.py (original)
+++ erp5/trunk/products/ERP5Form/ListBox.py Wed Nov 28 18:51:34 2007
@@ -38,12 +38,11 @@
 from Products.ERP5Type.Utils import getPath
 from Products.ERP5Type.Document import newTempBase
 from Products.CMFCore.utils import getToolByName
-from Products.CMFCore.utils import _checkPermission
 from Products.ZSQLCatalog.zsqlbrain import ZSQLBrain
 from Products.ERP5Type.Message import Message
 
 from Acquisition import aq_base, aq_self
-from zLOG import LOG, WARNING
+from zLOG import LOG, WARNING, INFO
 from ZODB.POSException import ConflictError
 
 from Globals import InitializeClass, Acquisition, get_request
@@ -52,14 +51,13 @@
 
 import md5
 import cgi
-import types
+from traceback import extract_stack
 
 # For compatibility with Python 2.3.
 try:
   set
 except NameError:
   from sets import Set as set
-
 
 class ObjectValuesWrapper:
   """This class wraps objectValues so that objectValues behaves like portal_catalog.
@@ -422,7 +420,7 @@
   def getPhysicalPath(self):
     """
       Return the path of form we render.
-      This function is required to be able to use ZopeProfiler product with 
+      This function is required to be able to use ZopeProfiler product with
       listbox.
     """
     return self.field.getPhysicalPath()
@@ -985,7 +983,7 @@
     # objects in the current ListBox configuration.
     if 'select_expression' in params:
       del params['select_expression']
-    
+
     self.getSelection().edit(params=params)
     return params
 
@@ -1395,7 +1393,7 @@
         else:
           original_value = stat_method
           processed_value = original_value
-      
+
       editable_field = self.getEditableField(alias)
       if editable_field is not None:
         processed_value = editable_field.render_view(value=original_value)
@@ -1770,7 +1768,6 @@
       if context is not None:
         return context.getTitleOrId() or ''
     return ''
-        
 
   def getDepth(self):
     """Return the depth of a domain. Used only for a summary line.
@@ -1857,7 +1854,7 @@
             original_value = editable_field.__of__(obj).get_value('default',
                                                         cell=brain)
             processed_value = original_value
-        
+
         # If a tales expression is not defined, get a skin, an accessor or a property.
         if not tales:
           if hasattr(aq_self(brain), alias):
@@ -2035,7 +2032,7 @@
           error_text = error_dict[key].error_text
           error_text = cgi.escape(error_text)
           if isinstance(error_text, str):
-            error_text = u'%s' % Message(domain=ui_domain, 
+            error_text = u'%s' % Message(domain=ui_domain,
                                          message=error_text)
           error_message = u'<br />' + error_text
         else:
@@ -2841,11 +2838,10 @@
         selection_name = field.get_value('selection_name')
         #LOG('ListBoxValidator', 0, 'field = %s, selection_name = %s' % (repr(field), repr(selection_name)))
         params = here.portal_selections.getSelectionParamsFor(
-                                                           selection_name, 
+                                                           selection_name,
                                                            REQUEST=REQUEST)
         portal_url = getToolByName(here, 'portal_url')
         portal = portal_url.getPortalObject()
-
 
         result = {}
         error_result = {}
@@ -3052,7 +3048,6 @@
       name = list_method
     return name or None
 
-
 class ListBoxLine:
   meta_type = "ListBoxLine"
   security = ClassSecurityInfo()
@@ -3240,7 +3235,6 @@
     """
     self.is_section_folded = is_section_folded
 
-
   security.declarePublic('isSectionFolded')
   def isSectionFolded(self):
     """
@@ -3278,7 +3272,6 @@
     else:
       config_column = [self.config_dict[column_id] for column_id in self.config_display_list]
 
-
     return config_column + [self.column_dict[column_id] for column_id in column_id_list]
 
   security.declarePublic('getColumnItemList')

Modified: erp5/trunk/products/ERP5Form/SelectionTool.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Form/SelectionTool.py?rev=17882&r1=17881&r2=17882&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Form/SelectionTool.py (original)
+++ erp5/trunk/products/ERP5Form/SelectionTool.py Wed Nov 28 18:51:34 2007
@@ -30,29 +30,19 @@
   ERP5 portal_selection tool.
 """
 
-from OFS.Traversable import NotFound
 from OFS.SimpleItem import SimpleItem
 from Products.CMFCore.utils import UniqueObject
 from Globals import InitializeClass, DTMLFile, PersistentMapping, get_request
-from ZTUtils import make_query
 from AccessControl import ClassSecurityInfo
 from Products.ERP5Type.Tool.BaseTool import BaseTool
 from Products.ERP5Type import Permissions as ERP5Permissions
 from Products.ERP5Form import _dtmldir
 from Selection import Selection, DomainSelection
 from ZPublisher.HTTPRequest import FileUpload
-from email.MIMEBase import MIMEBase
-from email import Encoders
-from copy import copy
-from DateTime import DateTime
 import md5
-import pickle
-import hmac
-import random
-import re
 import string
-from zLOG import LOG, WARNING, INFO
-from Acquisition import Implicit, aq_base
+from zLOG import LOG, INFO
+from Acquisition import aq_base
 from Products.ERP5Type.Message import Message
 import warnings
 
@@ -726,7 +716,7 @@
         params = selection.getParams()
         zoom_start = request.form.get('zoom_start',0)
         params['zoom_start'] = zoom_start
-        selection.edit(params= params)
+        selection.edit(params=params)
       if REQUEST is not None:
         return self._redirectToOriginalForm(REQUEST=REQUEST, form_id=form_id,
                                            query_string=query_string)
@@ -794,7 +784,7 @@
         return self._redirectToOriginalForm(REQUEST=REQUEST,
                                             form_id=form_id,
                                              query_string=query_string)
-    
+
     security.declareProtected(ERP5Permissions.View, 'setDomainRoot')
     def setDomainRoot(self, REQUEST, form_id=None, query_string=None):
       """
@@ -963,7 +953,7 @@
       # It is better to reset the query when changing the display mode.
       params = selection.getParams()
       if 'where_expression' in params: del params['where_expression']
-      selection.edit(params = params)
+      selection.edit(params=params)
 
       if redirect:
         return self._redirectToOriginalForm(REQUEST=request, form_id=form_id,




More information about the Erp5-report mailing list