Changeset 938 for pykota

Show
Ignore:
Timestamp:
04/17/03 15:47:28 (22 years ago)
Author:
jalet
Message:

Help added during installation.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • pykota/trunk/setup.py

    r920 r938  
    2323# 
    2424# $Log$ 
     25# Revision 1.9  2003/04/17 13:47:28  jalet 
     26# Help added during installation. 
     27# 
    2528# Revision 1.8  2003/04/15 17:49:29  jalet 
    2629# Installation script now checks the presence of Netatalk 
     
    8487    return result 
    8588     
    86 def checkWithPrompt(prompt, module=None, command=None) : 
     89def checkWithPrompt(prompt, module=None, command=None, help=None) : 
    8790    """Tells the user what will be checked, and asks him what to do if something is absent.""" 
    8891    sys.stdout.write("Checking for %s availability : " % prompt) 
     
    98101        sys.stdout.write("NO.\n") 
    99102        sys.stderr.write("ERROR : %s not available !\n" % prompt) 
     103        if help is not None : 
     104            sys.stout.write("%s\n" % help) 
    100105        answer = raw_input("%s is missing. Do you want to continue anyway (y/N) ? " % prompt) 
    101106        if answer[0:1].upper() == 'Y' : 
     
    143148    # checks if some needed Python modules are there or not. 
    144149    modulestocheck = [("PygreSQL", "pg"), ("mxDateTime", "mx.DateTime")] 
    145     commandstocheck = [("SNMP Tools", "snmpget"), ("Netatalk", "pap")] 
     150    commandstocheck = [("SNMP Tools", "snmpget", "SNMP Tools are needed if you want to use SNMP enabled printers."), ("Netatalk", "pap", "Netatalk is needed if you want to use AppleTalk enabled printers.")] 
    146151    for (name, module) in modulestocheck : 
    147152        action = checkWithPrompt(name, module=module) 
     
    151156             
    152157    # checks if some software are there or not. 
    153     for (name, command) in commandstocheck : 
    154         action = checkWithPrompt(name, command=command) 
     158    for (name, command, help) in commandstocheck : 
     159        action = checkWithPrompt(name, command=command, help=help) 
    155160        if action == ACTION_ABORT : 
    156161            sys.stderr.write("Aborted !\n")