commit-gnue
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gnue] r9130 - trunk/gnue-forms/src/input/displayHandlers


From: reinhard
Subject: [gnue] r9130 - trunk/gnue-forms/src/input/displayHandlers
Date: Tue, 12 Dec 2006 06:58:46 -0600 (CST)

Author: reinhard
Date: 2006-12-12 06:58:46 -0600 (Tue, 12 Dec 2006)
New Revision: 9130

Modified:
   trunk/gnue-forms/src/input/displayHandlers/Checkbox.py
   trunk/gnue-forms/src/input/displayHandlers/Component.py
   trunk/gnue-forms/src/input/displayHandlers/Cursor.py
   trunk/gnue-forms/src/input/displayHandlers/DateTime.py
   trunk/gnue-forms/src/input/displayHandlers/Dropdown.py
   trunk/gnue-forms/src/input/displayHandlers/Image.py
   trunk/gnue-forms/src/input/displayHandlers/Listbox.py
   trunk/gnue-forms/src/input/displayHandlers/Numeric.py
   trunk/gnue-forms/src/input/displayHandlers/Password.py
Log:
Get rid of _buildDisplayHelper().


Modified: trunk/gnue-forms/src/input/displayHandlers/Checkbox.py
===================================================================
--- trunk/gnue-forms/src/input/displayHandlers/Checkbox.py      2006-12-12 
12:53:54 UTC (rev 9129)
+++ trunk/gnue-forms/src/input/displayHandlers/Checkbox.py      2006-12-12 
12:58:46 UTC (rev 9130)
@@ -80,11 +80,6 @@
       return value and True or False
 
 
-  # TODO: Replace with format mask
-  def _buildDisplayHelper(self, value, editing):
-    return self.__sanitize_value(value)
-
-
   # Helpers for user events:
 
   # Set checkbox to boolean value

Modified: trunk/gnue-forms/src/input/displayHandlers/Component.py
===================================================================
--- trunk/gnue-forms/src/input/displayHandlers/Component.py     2006-12-12 
12:53:54 UTC (rev 9129)
+++ trunk/gnue-forms/src/input/displayHandlers/Component.py     2006-12-12 
12:58:46 UTC (rev 9130)
@@ -33,10 +33,6 @@
   def __init__(self, entry, eventHandler, subEventHandler):
     BaseCursor.__init__(self, entry, eventHandler, subEventHandler)
 
-  def _buildDisplayHelper(self, value, editing):
-    if self.entry.type.lower() == 'url':
-      return value
-
   def build_display(self, value, editing):
         if self.entry.type.lower() == 'url':
             return value

Modified: trunk/gnue-forms/src/input/displayHandlers/Cursor.py
===================================================================
--- trunk/gnue-forms/src/input/displayHandlers/Cursor.py        2006-12-12 
12:53:54 UTC (rev 9129)
+++ trunk/gnue-forms/src/input/displayHandlers/Cursor.py        2006-12-12 
12:58:46 UTC (rev 9130)
@@ -120,14 +120,6 @@
   # General methods
   #
 
-  def getDisplayFiller(self, value):
-    """
-    Returns the value as it should be displayed in the entry.
-    
-    @param value: The value to be formatted for display
-    """
-    return self._buildDisplayHelper(value, False)
-
   def generateRefreshEvent(self):
     """
     Function to emit an event that will cause forms
@@ -183,8 +175,7 @@
     self.modified = False
 
     # TODO: Replace with formatter
-    value = self.field.getValue()
-    self.work = self._buildDisplayHelper(value, False)
+    self.work = self.field.get_value() or u""
     self.display = self.build_display(self.work, True)
 
     self._cursor = len(self.display)

Modified: trunk/gnue-forms/src/input/displayHandlers/DateTime.py
===================================================================
--- trunk/gnue-forms/src/input/displayHandlers/DateTime.py      2006-12-12 
12:53:54 UTC (rev 9129)
+++ trunk/gnue-forms/src/input/displayHandlers/DateTime.py      2006-12-12 
12:58:46 UTC (rev 9130)
@@ -114,7 +114,3 @@
         year = year + 2000
 
     return datetime.datetime(year, int(month), int(day))
-
-
-  def _buildDisplayHelper(self, value, editing):
-    return self.build_display(value, editing)

Modified: trunk/gnue-forms/src/input/displayHandlers/Dropdown.py
===================================================================
--- trunk/gnue-forms/src/input/displayHandlers/Dropdown.py      2006-12-12 
12:53:54 UTC (rev 9129)
+++ trunk/gnue-forms/src/input/displayHandlers/Dropdown.py      2006-12-12 
12:58:46 UTC (rev 9130)
@@ -78,23 +78,3 @@
     # Make sure to keep the UI in sync !
     self.setSelectionArea(0, self._cursor)
     self.generateRefreshEvent()
-
-
-  # TODO: Replace with format mask
-  def _buildDisplayHelper(self, value, editing):
-    if value in (None, ""):
-      return ""
-
-    if editing:
-      val = value.lower()
-      for disp in self.field._allowedValuesDescr:
-        if disp[:len(val)].lower() == val:
-          display = 
self.field._allowedValues[self.field._allowedValuesReverse[disp]]
-          return display
-      return value
-
-    if self.field._allowedValues is not None \
-            and self.field._allowedValues.has_key ("%s" % value):
-      return self.field._allowedValues ["%s" % value]
-    else:
-      return ""

Modified: trunk/gnue-forms/src/input/displayHandlers/Image.py
===================================================================
--- trunk/gnue-forms/src/input/displayHandlers/Image.py 2006-12-12 12:53:54 UTC 
(rev 9129)
+++ trunk/gnue-forms/src/input/displayHandlers/Image.py 2006-12-12 12:58:46 UTC 
(rev 9130)
@@ -74,6 +74,3 @@
     else:
         image = PILImage.new("RGB", (1, 1, ))
     return image
-
-  def _buildDisplayHelper(self, value, editing):
-    return self.build_display(value, editing)

Modified: trunk/gnue-forms/src/input/displayHandlers/Listbox.py
===================================================================
--- trunk/gnue-forms/src/input/displayHandlers/Listbox.py       2006-12-12 
12:53:54 UTC (rev 9129)
+++ trunk/gnue-forms/src/input/displayHandlers/Listbox.py       2006-12-12 
12:58:46 UTC (rev 9130)
@@ -73,24 +73,6 @@
 
     self._cursor = len(self.display)
 
-  # TODO: Replace with format mask
-  def _buildDisplayHelper(self, value, editing):
-    if value in (None, ""):
-      return ""
-
-    if editing:
-      val = value.lower()
-      for disp in self.field._allowedValuesDescr:
-        if disp[:len(val)].lower() == val:
-          display = 
self.field._allowedValues[self.field._allowedValuesReverse[disp]]
-          return display
-      return value
-
-    if self.field._allowedValues.has_key ("%s" % value):
-      return self.field._allowedValues ["%s" % value]
-    else:
-      return ""
-
   def _replaceText(self, event):
     self._selection1 = 0
     self._selection2 = len(self.display)

Modified: trunk/gnue-forms/src/input/displayHandlers/Numeric.py
===================================================================
--- trunk/gnue-forms/src/input/displayHandlers/Numeric.py       2006-12-12 
12:53:54 UTC (rev 9129)
+++ trunk/gnue-forms/src/input/displayHandlers/Numeric.py       2006-12-12 
12:58:46 UTC (rev 9130)
@@ -40,30 +40,6 @@
     BaseCursor.__init__(self, entry, eventHandler, subEventHandler)
 
 
-  def _buildDisplayHelper(self, val, editing):
-    try:
-      if val in (None, ""):
-        return ""
-    except TypeError:
-      pass
-
-    if editing and type(val) == types.StringType:
-      return val
-
-    value = val
-    try:
-      if int(value) == value:
-        value = "%d" % value
-      else:
-        value = "%s" % value
-    except OverflowError:
-        value = "%s" % value
-    except ValueError:
-        value = "%s" % value
-
-    return value
-
-
   def parse_display(self, display):
     if not len(display):
         return None

Modified: trunk/gnue-forms/src/input/displayHandlers/Password.py
===================================================================
--- trunk/gnue-forms/src/input/displayHandlers/Password.py      2006-12-12 
12:53:54 UTC (rev 9129)
+++ trunk/gnue-forms/src/input/displayHandlers/Password.py      2006-12-12 
12:58:46 UTC (rev 9130)
@@ -76,6 +76,3 @@
       return ""
     else:
       return "*" * len(str(value))
-
-  def _buildDisplayHelper(self, value, editing):
-    return self.build_display(value, editing)





reply via email to

[Prev in Thread] Current Thread [Next in Thread]