Example #1
0
def execute(input, options, environment):

    def interpret(input):
        if isinstance(input, iotypes.File):
            return input
        else:
            return iotypes.File(input)
        
    if input:
        #assert len(options) == 0
        file = interpret(input)
    else:
        #assert len(options) == 1
        file = interpret(options[0])

    if isinstance(file, iotypes.Directory):
        return show_directory(file)
    elif icon.is_thumbnailable(file):
        _output = show_image(file)
    elif isinstance(file, iotypes.CodeFile):
        _output = html.div(get_highlight(file), clazz='text')
    else: # else assume text file for now
        _output = html.div(show_text(file), clazz='text')

    output.print_misc(_output, 'show')
Example #2
0
def execute(input, options, environment):

    output.print_misc(get_message(), "banner")
Example #3
0
def execute(input, options, environment):
    # return '<div class="error">' + options[0] + '</div>'

    from control import output
    output.print_misc(options[0], 'error')
    return []
Example #4
0
def execute(input, options, environment):
    import fluidic # FIXME put at top without breaking
    version = fluidic.version
    name = fluidic.name
    banner = '<div class="banner"> ' + name + ' v' + version + '</div>'
    output.print_misc(banner, 'banner')