commit-gnue
[Top][All Lists]
Advanced

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

gnue common/src/GParser.py forms/src/GFClient.p...


From: James Thompson
Subject: gnue common/src/GParser.py forms/src/GFClient.p...
Date: Wed, 27 Nov 2002 00:47:07 -0500

CVSROOT:        /cvsroot/gnue
Module name:    gnue
Changes by:     James Thompson <address@hidden> 02/11/27 00:47:06

Modified files:
        common/src     : GParser.py 
        forms/src      : GFClient.py GFForm.py GFParser.py 
Added files:
        forms/samples/dialog: dialog.gfd 

Log message:
        start of <dialog> support (still useless)

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/common/src/GParser.py.diff?tr1=1.52&tr2=1.53&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/forms/samples/dialog/dialog.gfd?rev=1.1
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/forms/src/GFClient.py.diff?tr1=1.55&tr2=1.56&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/forms/src/GFForm.py.diff?tr1=1.208&tr2=1.209&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/forms/src/GFParser.py.diff?tr1=1.96&tr2=1.97&r1=text&r2=text

Patches:
Index: gnue/common/src/GParser.py
diff -c gnue/common/src/GParser.py:1.52 gnue/common/src/GParser.py:1.53
*** gnue/common/src/GParser.py:1.52     Tue Nov 26 18:45:20 2002
--- gnue/common/src/GParser.py  Wed Nov 27 00:47:06 2002
***************
*** 203,211 ****
          pass
  
    def finalValidation(self):
!     for element in self._singleInstanceTags:
!       if self._tagCounts[element] > 1:
!         raise MarkupError, _("File has multiple instances of <%s> when only 
one allowed") % (element)
  
      for element in self._requiredTags:
        if self._tagCounts[element] < 1:
--- 203,212 ----
          pass
  
    def finalValidation(self):
!     # TODO: too simple a validation need to be per object instance
!     #for element in self._singleInstanceTags:
!     #  if self._tagCounts[element] > 1:
!     #    raise MarkupError, _("File has multiple instances of <%s> when only 
one allowed") % (element)
  
      for element in self._requiredTags:
        if self._tagCounts[element] < 1:
Index: gnue/forms/src/GFClient.py
diff -c gnue/forms/src/GFClient.py:1.55 gnue/forms/src/GFClient.py:1.56
*** gnue/forms/src/GFClient.py:1.55     Fri Nov 15 18:12:36 2002
--- gnue/forms/src/GFClient.py  Wed Nov 27 00:47:06 2002
***************
*** 188,193 ****
--- 188,194 ----
        form = loadFile (fileHandle, instance)
        fileHandle.close()
  
+       #form.showTree()
        #
        # Start the instance
        #
Index: gnue/forms/src/GFForm.py
diff -c gnue/forms/src/GFForm.py:1.208 gnue/forms/src/GFForm.py:1.209
*** gnue/forms/src/GFForm.py:1.208      Tue Nov 26 18:45:20 2002
--- gnue/forms/src/GFForm.py    Wed Nov 27 00:47:06 2002
***************
*** 73,85 ****
  
      self._triggerns={}
  
!     
      # Hackery until proper layout support is added
      self._xmlnamespaces = {'c': 'GNUe:Forms:Character'}
  
  
      # The "None" init gives datasources time to setup master/detail
!     self._inits = [self.primaryInit, None, self.secondaryInit]
  
      #
      # New trigger support
--- 73,85 ----
  
      self._triggerns={}
  
!     self._dialogDictionary={}
      # Hackery until proper layout support is added
      self._xmlnamespaces = {'c': 'GNUe:Forms:Character'}
  
  
      # The "None" init gives datasources time to setup master/detail
!     self._inits = [self.primaryInit, None, self.secondaryInit, 
self.reapDialogs]
  
      #
      # New trigger support
***************
*** 135,140 ****
--- 135,158 ----
  
  
    #
+   # Modify the base phaseInit to only process
+   #
+   def phaseInit(self, iterations=5, dialogInit=0):
+     if self.style != 'dialog' or dialogInit:
+       for phase in range(iterations):
+         self._phaseInit(phase, dialogInit=dialogInit)
+                   
+   def _phaseInit(self,phase,dialogInit=0):
+     if self.style != 'dialog' or dialogInit:
+       if (len(self._inits) > phase) and self._inits[phase]:
+         GDebug.printMesg(6,"%s: Init Phase %s" % (self._type, phase+1))
+         self._inits[phase]()
+ 
+       for child in self._children:
+         if isinstance(child, GObj):
+           child._phaseInit(phase)
+           
+   #
    # Convert some deprecated options to new style
    #
    def _buildObject(self):
***************
*** 165,171 ****
    # Called during phaseInit startup by GParser.
    #
    def primaryInit(self):
- 
      # Initialize our events system
      events.EventAware.__init__(self, self._app.eventController)
  
--- 183,188 ----
***************
*** 196,201 ****
--- 213,230 ----
      self.processTrigger('On-Startup')
  
  
+   #
+   # removes the dialog forms from the main tree before
+   # any UI stuff is constructed
+   #
+   def reapDialogs(self):
+     for child in self._children:
+       if isinstance(child, GFForm):
+         # TODO : Might init them at this stage
+         self._dialogDictionary[child.name] = child
+         self._children.remove(child)
+     print "GFForm dialogs"
+     print self._dialogDictionary
    #
    # Get a user parameter. If parameter not specified, pull default value
    #
Index: gnue/forms/src/GFParser.py
diff -c gnue/forms/src/GFParser.py:1.96 gnue/forms/src/GFParser.py:1.97
*** gnue/forms/src/GFParser.py:1.96     Tue Nov 26 21:45:35 2002
--- gnue/forms/src/GFParser.py  Wed Nov 27 00:47:06 2002
***************
*** 754,765 ****
      #
      # Create the dialog alias for the forms
      #
! #    dialog=xmlElements['form']
! #    dialog['Required'] = 0
! #    dialog['SingleInstance'] = 0
! #    dialog['Attributes']['style']['Default']='dialog'
! #    dialog['ParentTags']= ('form',)
! #    xmlElements.update(dialog)
        
  
      #
--- 754,769 ----
      #
      # Create the dialog alias for the forms
      #
!     copy._deepcopy_dispatch[types.FunctionType] = copy._deepcopy_atomic
!     copy._deepcopy_dispatch[types.ClassType] = copy._deepcopy_atomic
!     copy._deepcopy_dispatch[type(int)] = copy._deepcopy_atomic                
            
!     dialog=copy.deepcopy(xmlElements['form'])
!     dialog['Required'] = 0
!     dialog['SingleInstance'] = 0
!     dialog['Importable'] = 1
!     dialog['Attributes']['style']['Default']='dialog'
!     dialog['ParentTags']= ('form',)
!     xmlElements.update({'dialog':dialog})
        
  
      #




reply via email to

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