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:04:46 -0400

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

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

Log message:
        First attempt to cleanup output format.

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

Patches:
Index: gnue/geas/examples/python/schema.py
diff -u gnue/geas/examples/python/schema.py:1.13 
gnue/geas/examples/python/schema.py:1.14
--- gnue/geas/examples/python/schema.py:1.13    Mon Oct  1 13:33:36 2001
+++ gnue/geas/examples/python/schema.py Mon Oct  1 14:04:46 2001
@@ -7,13 +7,14 @@
 # a test file: relies on GEAS being run from gnue/geas/src
 # and this from gnue/geas/examples/python
 #
-# $Id: schema.py,v 1.13 2001/10/01 17:33:36 ntiffin Exp $
+# $Id: schema.py,v 1.14 2001/10/01 18:04:46 ntiffin Exp $
 
 import re
 import sys
 import md5
 from string import *
 
+print_help = "n"
 
 def get_help_object2( full_class_name, field_name, language = "en", 
dialect="us"):
             # does not handle language correctly but is very fast
@@ -78,6 +79,21 @@
    return 
 
 
+def get_boolean_input(a_string):
+   cmd = ""
+   while cmd != "y" and cmd != "n":
+      print a_string + " [q,y,n]",
+      cmd = raw_input("")
+      cmd = cmd.lower()
+      if cmd == "q":
+         print ""
+         print "Thank you for playing.."
+         print ""
+         sys.exit(0)
+   print ""
+   return cmd
+
+
 def get_numeric_input(a_string, min_value, max_value):
    idx = max_value + 1
    while idx < min_value or idx > max_value:
@@ -256,6 +272,7 @@
    print "Defined in file: " + class_definition.gcdfilename
    return
 
+
 try:
    import CORBA
    CORBA._load_idl("../../idl/geas.idl")
@@ -284,7 +301,10 @@
    print "Unknown error - server could not respond to a request"
    print ""
    sys.exit(0)
-print "Succeeded"
+# print "Succeeded"
+
+print_help = get_boolean_input("Do you want to display help info?")
+print "Print help: %s" % print_help
 
 while 1:
    try:



reply via email to

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