Exemple #1
0
def rawInput(prompt, termObj=None):
    """use this to replace built-in raw-input, as this provides
    line wrapping on the query message if possible"""
    if termObj != None:  # all athenacl sessions have a termObj
        h, w = termObj.size()  # fit to terminal
        prompt = typeset.wrapText(prompt, w, 0, 'line')
    # line wraping may remove the last space after prompt; make sure it is
    # still there
    return input(_fixQuery(prompt))
Exemple #2
0
def rawInput(prompt, termObj=None):
    """use this to replace built-in raw-input, as this provides
    line wrapping on the query message if possible"""
    if termObj != None: # all athenacl sessions have a termObj
        h, w = termObj.size()# fit to terminal
        prompt = typeset.wrapText(prompt, w, 0, 'line')
    # line wraping may remove the last space after prompt; make sure it is 
    # still there
    return raw_input(_fixQuery(prompt))
Exemple #3
0
def msgError(msg, termObj=None):
    """almost all text outputted to user goes through this fuction
    general filter for all text display
    athenaCmd.Interpreter.out uses this f to output main text
    other command in Interpreter use sys.stdout
    """
    if termObj != None:  # all athenacl sessions have a termObj
        h, w = termObj.size()  # fit to terminal
        msg = typeset.wrapText(msg, w, 0, 'line')
    if termObj != None:
        if termObj.sessionType == 'cgi':  # dont want any output
            return  # do nothing, nothing to stderr, str taken elsewhere
    sys.stderr.write(msg)
Exemple #4
0
def msgError(msg, termObj=None):
    """almost all text outputted to user goes through this fuction
    general filter for all text display
    athenaCmd.Interpreter.out uses this f to output main text
    other command in Interpreter use sys.stdout
    """
    if termObj != None: # all athenacl sessions have a termObj
        h, w = termObj.size()# fit to terminal
        msg = typeset.wrapText(msg, w, 0, 'line')
    if termObj != None:
        if termObj.sessionType == 'cgi': # dont want any output
            return # do nothing, nothing to stderr, str taken elsewhere
    sys.stderr.write(msg)