commit-gnue
[Top][All Lists]
Advanced

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

gnue/designer/src/forms/wizards CreateSchema.py


From: Jason Cater
Subject: gnue/designer/src/forms/wizards CreateSchema.py
Date: Wed, 24 Jul 2002 10:03:30 -0400

CVSROOT:        /cvsroot/gnue
Module name:    gnue
Changes by:     Jason Cater <address@hidden>    02/07/24 10:03:30

Modified files:
        designer/src/forms/wizards: CreateSchema.py 

Log message:
        minor improvements to jan's createschema plug-in (supports writing to a 
file and moved to Extras menu)

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/designer/src/forms/wizards/CreateSchema.py.diff?tr1=1.1&tr2=1.2&r1=text&r2=text

Patches:
Index: gnue/designer/src/forms/wizards/CreateSchema.py
diff -c gnue/designer/src/forms/wizards/CreateSchema.py:1.1 
gnue/designer/src/forms/wizards/CreateSchema.py:1.2
*** gnue/designer/src/forms/wizards/CreateSchema.py:1.1 Tue Jul 23 20:10:42 2002
--- gnue/designer/src/forms/wizards/CreateSchema.py     Wed Jul 24 10:03:30 2002
***************
*** 68,77 ****
      if step == '0':
  
        content = [WizardText('This will create a GNUe schema definition \n'+
!                             'according to the needs of this form.\n\n'+
!                             'Writing to a file is not supported at the 
moment'+
!                             '\n.. so just press "Finish".'),
!                  WizardInput('name',label='File Name:',required=1,size=20)]
  
        return   { 'title': 'Create Schema Definition',
                   'content': content,
--- 68,75 ----
      if step == '0':
  
        content = [WizardText('This will create a GNUe schema definition \n'+
!                             'according to the needs of this form.\n\n'), 
!                  WizardInput('file',label='File Name:',required=1,size=20)]
  
        return   { 'title': 'Create Schema Definition',
                   'content': content,
***************
*** 102,130 ****
    #
    def Finalize(self):
  
-     attrs = {'name': self.variables['name'] or 'Dropdown_1'}
- 
      self.fieldlistoftable = {}
      self.schema = GSSchema()
      self.gstables = GSTables(self.schema)
      
      self.form.walk(self.createschema)
  
      
!     schemafile = """<?xml version=\"1.0\"?>
! 
! <!--  GNUe Designer (0.3.0)
!       Schema saved on: 2002-XX-XX XX:XX:XX  -->
! 
! """+self.schema.dumpXML()
! 
!     # TODO: now there should be an option to write the schema to a file
!     #       or to add it to another schema
!     #       or to open it (directly) in the schema designer
  
!     # as a temporary solution you can use a pipe to save it to a file:
!     # gfdes xxx.gfd > myschema.gsd
!     print schemafile
  
      return 1
  
--- 100,120 ----
    #
    def Finalize(self):
  
      self.fieldlistoftable = {}
      self.schema = GSSchema()
      self.gstables = GSTables(self.schema)
      
      self.form.walk(self.createschema)
  
+     dest = open(self.variables['file'],"w")
      
!     dest.write("""<?xml version="1.0"?>
! <!-- Schema definition created by GNUe Designer's 
!      "Create Schema from Form" plugin -->
! """)
  
!     dest.write(self.schema.dumpXML())
!     dest.close()
  
      return 1
  
***************
*** 189,194 ****
      'Version' : VERSION,
      'Author' : 'The GNUe Designer Team',
      'Behavior': WIZARD,
!     'Location' : 'Tools|Addons|Create Schema Definition'
  }
  
--- 179,184 ----
      'Version' : VERSION,
      'Author' : 'The GNUe Designer Team',
      'Behavior': WIZARD,
!     'Location' : 'Extras|Create Schema from Form'
  }
  



reply via email to

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