commit-gnue
[Top][All Lists]
Advanced

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

gnue/gnue-common/src FormatMasks/BaseMask.py Fo...


From: Jason Cater
Subject: gnue/gnue-common/src FormatMasks/BaseMask.py Fo...
Date: Wed, 17 Oct 2001 18:26:53 -0400

CVSROOT:        /home/cvs
Module name:    gnue
Changes by:     Jason Cater <address@hidden>    01/10/17 18:26:53

Modified files:
        gnue-common/src/FormatMasks: BaseMask.py DateMask.py 
        gnue-common/src/dbdrivers/geas: DBdriver.py 

Log message:
        synching machines (surprise, huh?)

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue-common/src/FormatMasks/BaseMask.py.diff?cvsroot=OldCVS&tr1=1.5&tr2=1.6&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue-common/src/FormatMasks/DateMask.py.diff?cvsroot=OldCVS&tr1=1.9&tr2=1.10&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue-common/src/dbdrivers/geas/DBdriver.py.diff?cvsroot=OldCVS&tr1=1.16&tr2=1.17&r1=text&r2=text

Patches:
Index: gnue/gnue-common/src/FormatMasks/BaseMask.py
diff -u gnue/gnue-common/src/FormatMasks/BaseMask.py:1.5 
gnue/gnue-common/src/FormatMasks/BaseMask.py:1.6
--- gnue/gnue-common/src/FormatMasks/BaseMask.py:1.5    Tue Oct 16 18:07:13 2001
+++ gnue/gnue-common/src/FormatMasks/BaseMask.py        Wed Oct 17 18:26:53 2001
@@ -126,7 +126,7 @@
 
 class MaskInputInstance: 
   def __init__(self, handler):
-    self.handler = self
+    self.handler = handler
     self.index = 0
     self.cursor = 0
     self.display = "" 
@@ -170,19 +170,19 @@
     if self.cursor <= 0: 
       self.cursor = 0 
       self.direction = 1
-    elif self.cursor >= len(self.display)
+    elif self.cursor >= len(self.display):
       self.cursor = len(self.display)
       self.direction = -1
 
     section = 0
-    while section < len(self.inputMaskPos) and \
-          self.inputMaskPos[section] < pos:
+    while section < len(self.handler.inputMaskPos) and \
+          self.handler.inputMaskPos[section] < pos:
       section += 1
 
-    if section = len(self.handler.inputMaskPos): 
+    if section == len(self.handler.inputMaskPos): 
       self.cursor = len(self.display)
 
-    elif isinstance(self.handler.inputMaskPos[section], Literal)
+    elif isinstance(self.handler.inputMaskPos[section], Literal):
       self.moveCursor(self, direction)
 
     self.index = self.indexToCursor(self.cursor)
Index: gnue/gnue-common/src/FormatMasks/DateMask.py
diff -u gnue/gnue-common/src/FormatMasks/DateMask.py:1.9 
gnue/gnue-common/src/FormatMasks/DateMask.py:1.10
--- gnue/gnue-common/src/FormatMasks/DateMask.py:1.9    Tue Oct 16 18:07:13 2001
+++ gnue/gnue-common/src/FormatMasks/DateMask.py        Wed Oct 17 18:26:53 2001
@@ -51,7 +51,7 @@
 #  h:i p               12:29 pm
 #
 
-from BaseMask import BaseMask, MaskSection, Literal
+from BaseMask import BaseMask, MaskSection, Literal, MaskInputInstance
 from gnue.common import GDebug
 from gnue.common.GDateTime import GDateTime, InvalidDate
 from FormatExceptions import *
@@ -116,7 +116,7 @@
 
   def createInputHandler(self, value): 
     instance = MaskInputInstance(self)
-    instance.setValue(value)
+    instance.setText(value)
     return instance
 
   def getFormattedOutput(self, value, secondary=0):
@@ -148,8 +148,8 @@
     for i in range(len(self.inputHandlers)):
       if self.inputMaskLen[i]: 
         self.lastInputPos = i + self.inputMaskLen[i] - 1
-      if (i < len(self.inputMaskLen) - 1) and not self.inputMaskLen[i+1]):
-        rv += val[self.inputMaskLen
+      if (i < len(self.inputMaskLen) - 1) and not self.inputMaskLen[i+1]:
+        rv += val[self.inputMaskLen]
       if self.inputMaskLen[i] or isinstance(self.inputHandlers[i],Literal):
         rv += self.inputHandlers[i].getFormattedValue(val)
       elif len(padding):
@@ -170,9 +170,9 @@
         raise InvalidEntry, "Invalid Entry"
 
     return date
-    
 
 
+
 class _baseDateSection (MaskSection): 
   def __init__(self): 
     pass
@@ -569,7 +569,8 @@
   GDebug.setDebug(20)
   val = ""
   dates = DateMask(r'\D\a\t\e: A, B d, Y  \T\i\m\e: h:i:s','m.d.y')
-  val = dates.processEdit(val, '07/1601')
+  input = dates.createInputHandler('07/16/01')
+#  val = dates.processEdit(val, '07/1601')
   print dates.getFormattedInput(val, "_")
   print dates.getFormattedOutput(val)
 #  print "processEdit2 <= %s" %dates.processEdit(val, '27',2,4)
Index: gnue/gnue-common/src/dbdrivers/geas/DBdriver.py
diff -u gnue/gnue-common/src/dbdrivers/geas/DBdriver.py:1.16 
gnue/gnue-common/src/dbdrivers/geas/DBdriver.py:1.17
--- gnue/gnue-common/src/dbdrivers/geas/DBdriver.py:1.16        Thu Sep 27 
22:05:04 2001
+++ gnue/gnue-common/src/dbdrivers/geas/DBdriver.py     Wed Oct 17 18:26:53 2001
@@ -46,7 +46,7 @@
     
 except ImportError,ex:
     print "Failed to load CORBA module."
-    print "Please see http://projects.sault.org/orbit-python/ for the required 
python CORBA bindings"
+    print "Please see http://orbit-python.sault.org/ for the required python 
CORBA bindings"
     sys.exit(0)
 
 



reply via email to

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