Author: jmorliaguet
Date: Sun Jun  4 16:38:44 2006
New Revision: 3301

Modified:
   cpsskins/branches/paris-sprint-2006/ui/screens/common/views.py

Log:

- simplifications



Modified: cpsskins/branches/paris-sprint-2006/ui/screens/common/views.py
==============================================================================
--- cpsskins/branches/paris-sprint-2006/ui/screens/common/views.py      
(original)
+++ cpsskins/branches/paris-sprint-2006/ui/screens/common/views.py      Sun Jun 
 4 16:38:44 2006
@@ -265,15 +265,10 @@
 
     ### Elements  #####################################################
 
-    def _getElementById(self, id):
-        """Return an element by id.
-        """
-        return self.tmutil.getElementById(id)
-
     def renderElement(self, id=u'', engine=u'default'):
         """Render the element and return the markup
         """
-        element = self._getElementById(id)
+        element = self.tmutil.getElementById(id)
         request = self.request
 
         viewer = getMultiAdapter((element, request), IViewer)
@@ -282,7 +277,7 @@
     def editElement(self, id, name, value):
         """Edit the element: assign a value to an attribute (name).
         """
-        element = self._getElementById(id)
+        element = self.tmutil.getElementById(id)
         _marker = object()
 
         if getattr(element, name, _marker) is not _marker:
@@ -294,7 +289,7 @@
         """Copy an element to the clipboard.
         """
         request = self.request
-        element = self._getElementById(id)
+        element = self.tmutil.getElementById(id)
         container = getParent(element)
         request.form['ids'] = [getName(element)]
         view = Contents(container, request)
@@ -304,7 +299,7 @@
         """Paste an element from the clipboard.
         """
         request = self.request
-        element = self._getElementById(id)
+        element = self.tmutil.getElementById(id)
         container = getParent(element)
         view = Contents(container, request)
         view.pasteObjects()
@@ -314,7 +309,7 @@
         Return the id of inserted element.
         """
         request = self.request
-        dest_element = self._getElementById(id)
+        dest_element = self.tmutil.getElementById(id)
         if IInnerNode.providedBy(dest_element):
             container = dest_element
         else:
@@ -348,9 +343,9 @@
         return the id of the moved element.
         """
         request = self.request
-        src_element = self._getElementById(src_id)
+        src_element = self.tmutil.getElementById(src_id)
         src_container = getParent(src_element)
-        dest_element = self._getElementById(dest_id)
+        dest_element = self.tmutil.getElementById(dest_id)
         if IInnerNode.providedBy(dest_element):
             dest_container = dest_element
         else:
@@ -371,7 +366,7 @@
     def setElementOrder(self, id, order):
         """Move an element to a new position.
         """
-        element = self._getElementById(id)
+        element = self.tmutil.getElementById(id)
         container = getParent(element)
         ordering = getMultiAdapter((container, self.request), INodeOrdering)
         ordering.setOrder(element, int(order))
@@ -379,7 +374,7 @@
     def getElementOrder(self, id):
         """Get the order of an element in a container.
         """
-        element = self._getElementById(id)
+        element = self.tmutil.getElementById(id)
         container = getParent(element)
         ordering = getMultiAdapter((container, self.request), INodeOrdering)
         return ordering.getOrder(element)
@@ -388,7 +383,7 @@
         """Delete the element specified by its path.
         """
         request = self.request
-        element = self._getElementById(id)
+        element = self.tmutil.getElementById(id)
         container = getParent(element)
         removing = getMultiAdapter((container, request), INodeRemoving)
         removing.remove(element)
@@ -398,7 +393,7 @@
         Return the id of the duplicated element.
         """
         request = self.request
-        element = self._getElementById(id)
+        element = self.tmutil.getElementById(id)
         container = getParent(element)
         duplicating = getMultiAdapter((container, request), INodeDuplicating)
         return str(duplicating.duplicate(element))
-- 
http://lists.nuxeo.com/mailman/listinfo/z3lab-checkins

Reply via email to