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: Mon, 01 Oct 2001 14:29:11 -0400

CVSROOT:        /home/cvs
Module name:    gnue
Changes by:     Neil Tiffin <address@hidden>    01/10/01 14:29:11

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

Log message:
        Make help info optional and fix errors in class selection on last 
screen.

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

Patches:
Index: gnue/geas/examples/python/schema.py
diff -u gnue/geas/examples/python/schema.py:1.14 
gnue/geas/examples/python/schema.py:1.15
--- gnue/geas/examples/python/schema.py:1.14    Mon Oct  1 14:04:46 2001
+++ gnue/geas/examples/python/schema.py Mon Oct  1 14:29:10 2001
@@ -7,7 +7,7 @@
 # a test file: relies on GEAS being run from gnue/geas/src
 # and this from gnue/geas/examples/python
 #
-# $Id: schema.py,v 1.14 2001/10/01 18:04:46 ntiffin Exp $
+# $Id: schema.py,v 1.15 2001/10/01 18:29:10 ntiffin Exp $
 
 import re
 import sys
@@ -73,9 +73,15 @@
 def show_help_info( name, field):
    obj = get_help_object1( name, field )
    if obj:
-      print "      Help Text :  " + obj.getField("help_text")
-      print "      Tool Tip  :  " + obj.getField("tool_tip")
-      print "      Label     :  " + obj.getField("label")
+      h_text = obj.getField("help_text")
+      tt = obj.getField("tool_tip")
+      label = obj.getField("label")
+      if h_text:
+         print "                 Help Text: '%s'" % h_text
+      if tt:
+         print "                 Tool Tip: '%s'" % tt
+      if label:
+         print "                 Label: '%s'" % label
    return 
 
 
@@ -83,7 +89,7 @@
    cmd = ""
    while cmd != "y" and cmd != "n":
       print a_string + " [q,y,n]",
-      cmd = raw_input("")
+      cmd = raw_input(" ")
       cmd = cmd.lower()
       if cmd == "q":
          print ""
@@ -134,6 +140,7 @@
 
 
 def show_fields( class_definition ):
+   global print_help
    if len(class_definition.fields) == 0:
       print " (None)"
    else:
@@ -244,9 +251,6 @@
       if len(f.format) > 0: print "<"+ f.format +">",
       if f.defaultvalue != None and len(f.defaultvalue) > 0:
          print " = " + f.defaultvalue,
-      # print ", ",
-
-      # print "      Flags     : ",
       needcomma = 0
       if f.notnull:
          print "Not Null",
@@ -257,7 +261,8 @@
          needcomma =  1
       # if needcomma == 0: print "<None set>", # only happens if no flags are 
printed
       print ""
-      # print ""
+      if print_help == "y":
+         show_help_info( f.classname, f.name)
 
    return
 
@@ -304,7 +309,7 @@
 # print "Succeeded"
 
 print_help = get_boolean_input("Do you want to display help info?")
-print "Print help: %s" % print_help
+# print "Print help: %s" % print_help
 
 while 1:
    try:



reply via email to

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