commit-gnue
[Top][All Lists]
Advanced

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

gnue/geas/examples/python schema.py


From: Neil Tiffin
Subject: gnue/geas/examples/python schema.py
Date: Sun, 09 Sep 2001 11:46:02 -0700

CVSROOT:        /home/cvs
Module name:    gnue
Changes by:     Neil Tiffin <address@hidden>    01/09/09 11:46:02

Modified files:
        geas/examples/python: schema.py 

Log message:
        Add support for help text, tool tips, and labels as an example for 
forms developers.

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/geas/examples/python/schema.py.diff?cvsroot=OldCVS&tr1=1.8&tr2=1.9&r1=text&r2=text

Patches:
Index: gnue/geas/examples/python/schema.py
diff -u gnue/geas/examples/python/schema.py:1.8 
gnue/geas/examples/python/schema.py:1.9
--- gnue/geas/examples/python/schema.py:1.8     Fri Sep  7 12:25:31 2001
+++ gnue/geas/examples/python/schema.py Sun Sep  9 11:46:02 2001
@@ -7,12 +7,27 @@
 # a test file: relies on GEAS being run from gnue/geas/src
 # and this from gnue/geas/examples/python
 #
-# $Id: schema.py,v 1.8 2001/09/07 19:25:31 ntiffin Exp $
+# $Id: schema.py,v 1.9 2001/09/09 18:46:02 ntiffin Exp $
 
+import re
 import sys
 import md5
 from string import *
 
+def show_help_info( name, field):
+   # TODO does not handle language correctly 
+   classname = "language::help"
+   fieldname = "name"
+   fieldcontents = re.sub("::", "__", name+"."+field)
+   fieldcontents = re.sub("root__", "", fieldcontents)
+   # print "Looking for: " + fieldcontents
+   obj = con.loadSingleObject( classname, fieldname, fieldcontents)
+   if obj:
+      print "      Help Text : " + obj.getField("help_text")
+      print "      Tool Tip  : " + obj.getField("tool_tip")
+      print "      Label     : " + obj.getField("label")
+   return 
+
 def get_numeric_input(a_string, min_value, max_value):
    idx = max_value + 1
    while idx < min_value or idx > max_value:
@@ -52,6 +67,7 @@
    for f in class_definition.fields:
       print "Field Name: " + f.name
       print "      Defined in:  " + f.classname
+      show_help_info( f.classname, f.name)
       print "      Type      : ",
       if f.type   == GEAS.basic :
          print "Basic"
@@ -105,10 +121,14 @@
       print "      Datatype  : ",
       if f.datatype   == GEAS.Char: print "char",
       elif f.datatype == GEAS.Int: print "int",
+      elif f.datatype == GEAS.Int16: print "int16",
+      elif f.datatype == GEAS.Int32: print "int32",
+      elif f.datatype == GEAS.Int64: print "int64",
       elif f.datatype == GEAS.Text: print "text",
       elif f.datatype == GEAS.Class: print "class ("+f.datatypeclass+")",
       elif f.datatype == GEAS.Date: print "date",
       elif f.datatype == GEAS.Bool: print "bool",
+      elif f.datatype == GEAS.Boolean: print "boolean",
       elif f.datatype == GEAS.FloatValue: print "float",
       elif f.datatype == GEAS.Void: print "void",
       elif f.datatype == GEAS.ObjectRef: print "object",



reply via email to

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