示例#1
0
文件: nodes.py 项目: stephenhay/dexy
def print_node_info(alias):
    print alias

    _, settings = Node.plugins[alias]

    instance = Node.create_instance(alias, "dummy", dummy_wrapper())
    instance.update_settings(settings)

    print ''
    print instance.setting('help')
    print ''

    if len(instance._instance_settings) > 2:
        print('Settings:')

    for k in sorted(instance._instance_settings):
        if k in (
                'aliases',
                'help',
        ):
            continue

        tup = instance._instance_settings[k]
        print "    %s" % k

        for line in inspect.cleandoc(tup[0]).splitlines():
            print "        %s" % line

        print "        default value: %s" % tup[1]
        print ''
示例#2
0
文件: nodes.py 项目: GWhized/dexy
def print_node_info(alias):
    print alias

    _, settings = Node.plugins[alias]

    instance = Node.create_instance(alias, "dummy", dummy_wrapper())
    instance.update_settings(settings)

    print ''
    print instance.setting('help')
    print ''

    if len(instance._instance_settings) > 2:
        print('Settings:')

    for k in sorted(instance._instance_settings):
        if k in ('aliases', 'help',):
            continue

        tup = instance._instance_settings[k]
        print "    %s" % k

        for line in inspect.cleandoc(tup[0]).splitlines():
            print "        %s" % line

        print "        default value: %s" % tup[1]
        print ''
示例#3
0
def test_doc_node_populate():
    with wrap() as wrapper:
        node = Node.create_instance(
                'doc', "foo.txt", wrapper,
                [], contents='foo')

        assert node.key_with_class() == "doc:foo.txt"
示例#4
0
def test_doc_node_with_filters():
    with wrap() as wrapper:
        node = Node.create_instance('doc',
                                    "foo.txt|outputabc",
                                    wrapper, [],
                                    contents='foo')
        assert node.key_with_class() == "doc:foo.txt|outputabc"
示例#5
0
def test_doc_node_populate():
    with wrap() as wrapper:
        node = Node.create_instance('doc',
                                    "foo.txt",
                                    wrapper, [],
                                    contents='foo')

        assert node.key_with_class() == "doc:foo.txt"
示例#6
0
def test_doc_node_with_filters():
    with wrap() as wrapper:
        node = Node.create_instance('doc',
                "foo.txt|outputabc", wrapper, [], contents='foo')
        assert node.key_with_class() == "doc:foo.txt|outputabc"