Ejemplo n.º 1
0
def pipe_privateinput(context=None, _INPUT=None, conf=None, **kwargs):
    """This source prompts the user for some text and yields it forever.

    Keyword arguments:
    context -- pipeline context
    _INPUT -- not used
    conf:
        name -- input parameter name
        default -- default
        prompt -- prompt

    Yields (_OUTPUT):
    text
    """
    value = util.get_input(context, conf)

    while True:
        yield value
Ejemplo n.º 2
0
def pipe_privateinput(context, _INPUT, conf, **kwargs):
    """This source prompts the user for some text and yields it forever.
    
    Keyword arguments:
    context -- pipeline context
    _INPUT -- not used
    conf:
        name -- input parameter name
        default -- default
        prompt -- prompt

    Yields (_OUTPUT):
    text
    """
    value = util.get_input(context, conf)

    while True:
        yield value
Ejemplo n.º 3
0
def pipe_urlinput(context, _INPUT, conf, **kwargs):
    """This source prompts the user for a url and yields it forever.
    
    Keyword arguments:
    context -- pipeline context
    _INPUT -- not used
    conf:
        name -- input parameter name
        default -- default
        prompt -- prompt
    
    Yields (_OUTPUT):
    url
    """
    value = util.get_input(context, conf)

    #Ensure url is valid
    value = util.url_quote(value)

    while True:
        yield value
Ejemplo n.º 4
0
def pipe_urlinput(context, _INPUT, conf, **kwargs):
    """This source prompts the user for a url and yields it forever.
    
    Keyword arguments:
    context -- pipeline context
    _INPUT -- not used
    conf:
        name -- input parameter name
        default -- default
        prompt -- prompt
    
    Yields (_OUTPUT):
    url
    """
    value = util.get_input(context, conf)
        
    #Ensure url is valid
    value = urllib2.quote(value, safe="%/:=&?~#+!$,;'@()*[]")
        
    while True:
        yield value
Ejemplo n.º 5
0
def pipe_numberinput(context, _INPUT, conf, **kwargs):
    """This source prompts the user for a number and yields it forever.
    
    Keyword arguments:
    context -- pipeline context
    _INPUT -- not used
    conf:
        name -- input parameter name
        default -- default
        prompt -- prompt

    Yields (_OUTPUT):
    text
    """
    value = util.get_input(context, conf)
        
    try:
        value = float(value)
    except:
        value = 0
    
    while True:
        yield value
Ejemplo n.º 6
0
def pipe_numberinput(context, _INPUT, conf, **kwargs):
    """This source prompts the user for a number and yields it forever.
    
    Keyword arguments:
    context -- pipeline context
    _INPUT -- not used
    conf:
        name -- input parameter name
        default -- default
        prompt -- prompt

    Yields (_OUTPUT):
    text
    """
    value = util.get_input(context, conf)

    try:
        value = float(value)
    except:
        value = 0

    while True:
        yield value