Exemplo n.º 1
0
def apply(context, *args):
    _("""Like Unix xargs - take input and convert to arguments.""")

    newargs = list(args)
    for argument in context.input:
        if not isinstance(argument, str):
            argument = str(argument)
        newargs.append(argument)
        
    new_context = HotwireContext(initcwd=context.cwd)
    # TODO - pull in resolver from shell.py?  Should this function expand
    # aliases?        
    pipeline = Pipeline.create(new_context, None, *newargs)
    pipeline.execute_sync(assert_all_threaded=True)
    for result in pipeline.get_output():
        yield result
Exemplo n.º 2
0
 def __on_definedin_clicked(self, *args):
     from hotwire.command import Pipeline
     pl = Pipeline.create(None, None, 'edit', self.__definedin.get_text())
     pl.execute_sync()
Exemplo n.º 3
0
def script(*args, **kwargs):
    from hotwire.command import Pipeline, HotwireContext
    if not 'context' in kwargs:
        kwargs['context'] = HotwireContext(initcwd=(kwargs.get('cwd', None)))
    return Pipeline.create(kwargs['context'], kwargs.get('resolver', None),
                           *args)
Exemplo n.º 4
0
def script(*args, **kwargs):
    from hotwire.command import Pipeline,HotwireContext
    if not 'context' in kwargs:
        kwargs['context'] = HotwireContext(initcwd=(kwargs.get('cwd', None)))
    return Pipeline.create(kwargs['context'], kwargs.get('resolver', None), *args)