• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python autodoc.cut_lines函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中sphinx.ext.autodoc.cut_lines函数的典型用法代码示例。如果您正苦于以下问题:Python cut_lines函数的具体用法?Python cut_lines怎么用?Python cut_lines使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了cut_lines函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: setup

def setup(app):
	app.connect("autodoc-process-docstring", cut_lines(
		pre=1,
		post=11,
		what=["module"]
	))
	app.connect("autodoc-process-docstring", cut_lines(
		pre=1,
		what=["module","class","method","function","attribute","data","exception"]
	))
开发者ID:marceloalcocer,项目名称:ultrafast,代码行数:10,代码来源:conf.py


示例2: setup

def setup(app):
    from sphinx.ext.autodoc import cut_lines
    app.connect('autodoc-process-docstring', cut_lines(4, what=['module']))
    app.add_description_unit('directive', 'dir', 'pair: %s; directive', parse_directive)
    app.add_description_unit('role', 'role', 'pair: %s; role', parse_role)
    app.add_description_unit('confval', 'confval', 'pair: %s; configuration value')
    app.add_description_unit('event', 'event', 'pair: %s; event', parse_event)
开发者ID:axray,项目名称:dataware.dreamplug,代码行数:7,代码来源:conf.py


示例3: setup

def setup(app):
    # Avoid print the copyright intro in each module documentation
    from sphinx.ext.autodoc import cut_lines
    app.connect('autodoc-process-docstring', cut_lines(15, what=['module']))

    # Generate the meos documentation files
    app.connect('builder-inited', Autogenerate_MEoS)
开发者ID:jjgomera,项目名称:pychemqt,代码行数:7,代码来源:conf.py


示例4: setup

def setup(app):
    from sphinx.ext.autodoc import cut_lines
    app.connect('autodoc-process-docstring', cut_lines(4, what=['module']))
    app.add_description_unit('confval', 'confval',
                             objname='configuration value',
                             indextemplate='pair: %s; configuration value')
    app.add_description_unit('event', 'event', 'pair: %s; event', parse_event)
开发者ID:OpenBookProjects,项目名称:sphinx-doc-zh,代码行数:7,代码来源:conf.py


示例5: setup

def setup(app):
    from sphinx.ext.autodoc import cut_lines
    app.connect(b'autodoc-process-docstring', cut_lines(4, what=['module']))
    app.add_object_type(
        b'confval', 'confval',
        objname='configuration value',
        indextemplate='pair: %s; configuration value')
开发者ID:vorodev,项目名称:mopidy,代码行数:7,代码来源:conf.py


示例6: setup

def setup(app):
    from sphinx.ext.autodoc import between, cut_lines

    global autodoc_lang
    if "autodoc_lang" in app.config.overrides:
        autodoc_lang = app.config.overrides["autodoc_lang"]
    app.connect("autodoc-process-docstring", between("\.\.\s\[(/|)" + autodoc_lang + "\].*", ["function"]))
    app.connect("autodoc-process-docstring", cut_lines(1, what=["function"]))
开发者ID:Adman,项目名称:nxtIDE,代码行数:8,代码来源:conf.py


示例7: setup

def setup(app):
    from sphinx.ext.autodoc import cut_lines
    from sphinx.util.docfields import GroupedField

    app.connect("autodoc-process-docstring", cut_lines(4, what=["module"]))
    app.add_object_type(
        "confval", "confval", objname="configuration value", indextemplate="pair: %s; configuration value"
    )
    fdesc = GroupedField("parameter", label="Parameters", names=["param"], can_collapse=True)
    app.add_object_type("event", "event", "pair: %s; event", parse_event, doc_field_types=[fdesc])
开发者ID:karasusan,项目名称:sphinx-docs,代码行数:10,代码来源:conf.py


示例8: setup

def setup(app):
    from sphinx.ext.autodoc import cut_lines
    from sphinx.util.docfields import GroupedField
    app.connect('autodoc-process-docstring', cut_lines(4, what=['module']))
    app.add_object_type('confval', 'confval',
                        objname='configuration value',
                        indextemplate='pair: %s; configuration value')
    fdesc = GroupedField('parameter', label='Parameters',
                         names=['param'], can_collapse=True)
    app.add_object_type('event', 'event', 'pair: %s; event', parse_event,
                        doc_field_types=[fdesc])
开发者ID:certik,项目名称:sphinx,代码行数:11,代码来源:conf.py


示例9: test_docstring_processing

def test_docstring_processing():
    def process(objtype, name, obj):
        inst = AutoDirective._registry[objtype](directive, name)
        inst.object = obj
        inst.fullname = name
        return list(inst.process_doc(inst.get_doc()))

    class E:
        def __init__(self):
            """Init docstring"""

    # docstring processing by event handler
    assert process("class", "bar", E) == ["Init docstring", "", "42", ""]

    lid = app.connect("autodoc-process-docstring", cut_lines(1, 1, ["function"]))

    def f():
        """
        first line
        second line
        third line
        """

    assert process("function", "f", f) == ["second line", ""]
    app.disconnect(lid)

    lid = app.connect("autodoc-process-docstring", between("---", ["function"]))

    def g():
        """
        first line
        ---
        second line
        ---
        third line
        """

    assert process("function", "g", g) == ["second line", ""]
    app.disconnect(lid)

    lid = app.connect("autodoc-process-docstring", between("---", ["function"], exclude=True))

    def h():
        """
        first line
        ---
        second line
        ---
        third line
        """

    assert process("function", "h", h) == ["first line", "third line", ""]
    app.disconnect(lid)
开发者ID:robgolding,项目名称:django-braces,代码行数:53,代码来源:test_autodoc.py


示例10: test_docstring_processing

def test_docstring_processing():
    def process(objtype, name, obj):
        inst = AutoDirective._registry[objtype](directive, name)
        inst.object = obj
        inst.fullname = name
        return list(inst.process_doc(inst.get_doc()))

    class E:
        def __init__(self):
            """Init docstring"""

    # docstring processing by event handler
    assert process('class', 'bar', E) == ['Init docstring', '', '42', '']

    lid = app.connect('autodoc-process-docstring',
                      cut_lines(1, 1, ['function']))

    def f():
        """
        first line
        second line
        third line
        """
    assert process('function', 'f', f) == ['second line', '']
    app.disconnect(lid)

    lid = app.connect('autodoc-process-docstring', between('---', ['function']))

    def g():
        """
        first line
        ---
        second line
        ---
        third line
        """
    assert process('function', 'g', g) == ['second line', '']
    app.disconnect(lid)

    lid = app.connect('autodoc-process-docstring',
                      between('---', ['function'], exclude=True))

    def h():
        """
        first line
        ---
        second line
        ---
        third line
        """
    assert process('function', 'h', h) == ['first line', 'third line', '']
    app.disconnect(lid)
开发者ID:atodorov,项目名称:sphinx,代码行数:52,代码来源:test_autodoc.py


示例11: setup

def setup(app):
    from sphinx.ext.autodoc import cut_lines
    from sphinx.util.docfields import GroupedField
    app.connect('autodoc-process-docstring', cut_lines(4, what=['module']))
    app.add_object_type('confval', 'confval',
                        objname='configuration value',
                        indextemplate='pair: %s; configuration value')
    fdesc = GroupedField('parameter', label='Parameters',
                         names=['param'], can_collapse=True)
    app.add_object_type('event', 'event', 'pair: %s; event', parse_event,
                        doc_field_types=[fdesc])

    # workaround for RTD
    from sphinx.util import logging
    logger = logging.getLogger(__name__)
    app.info = lambda *args, **kwargs: logger.info(*args, **kwargs)
    app.warn = lambda *args, **kwargs: logger.warning(*args, **kwargs)
    app.debug = lambda *args, **kwargs: logger.debug(*args, **kwargs)
开发者ID:olivier-heurtier,项目名称:sphinx,代码行数:18,代码来源:conf.py


示例12: test_docstring_processing_functions

def test_docstring_processing_functions():
    lid = app.connect('autodoc-process-docstring', cut_lines(1, 1, ['function']))
    def f():
        """
        first line
        second line
        third line
        """
    assert list(gen.get_doc('function', 'f', f)) == ['second line', '']
    app.disconnect(lid)

    lid = app.connect('autodoc-process-docstring', between('---', ['function']))
    def f():
        """
        first line
        ---
        second line
        ---
        third line
        """
    assert list(gen.get_doc('function', 'f', f)) == ['second line', '']
    app.disconnect(lid)
开发者ID:BackupGGCode,项目名称:sphinx,代码行数:22,代码来源:test_autodoc.py


示例13: setup

def setup(app):
  #remove first line of module docstrings - it's module title
  from sphinx.ext.autodoc import cut_lines
  app.connect('autodoc-process-docstring', cut_lines(1, what=['module']))
开发者ID:gijs,项目名称:inasafe,代码行数:4,代码来源:conf.py


示例14: setup

def setup(app):
    from sphinx.ext.autodoc import cut_lines

    app.connect("autodoc-process-docstring", cut_lines(4, 2, what=["module"]))
开发者ID:fanchlegal,项目名称:framepy,代码行数:4,代码来源:conf.py


示例15: setup

def setup(app):
    from sphinx.ext.autodoc import cut_lines
    app.connect('autodoc-process-docstring', cut_lines(2, what=['module']))
开发者ID:Ascaf0,项目名称:synaptiks,代码行数:3,代码来源:conf.py


示例16: setup

def setup(app):
    from sphinx.ext.autodoc import cut_lines

    app.connect("autodoc-skip-member", autodoc_skip_member)
    app.connect("autodoc-process-docstring", cut_lines(2, what=["module"]))
开发者ID:saeidy,项目名称:tamkin,代码行数:5,代码来源:conf.py


示例17: setup

def setup(app):
    from sphinx.ext.autodoc import cut_lines
    app.connect('autodoc-process-docstring', cut_lines(1, what=['function']))
开发者ID:GunioRobot,项目名称:pymc,代码行数:3,代码来源:conf.py


示例18: setup

def setup(app):
    app.connect("autodoc-process-docstring", cut_lines(2, what=["module"]))
开发者ID:rizar,项目名称:attention-lvcsr,代码行数:2,代码来源:conf.py


示例19: setup

def setup(app):
    from sphinx.ext.autodoc import cut_lines
    app.connect(b'autodoc-process-docstring', cut_lines(2, what=['module']))
    app.add_directive('udevversion', UDevVersion)
开发者ID:lanstat,项目名称:pyudev,代码行数:4,代码来源:conf.py


示例20: setup

def setup(app):
    app.connect('missing-reference', missing_reference)
    app.connect('autodoc-process-docstring', cut_lines(2, what=['module']))
开发者ID:Alex201310,项目名称:gevent,代码行数:3,代码来源:mysphinxext.py



注:本文中的sphinx.ext.autodoc.cut_lines函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python autosummary.get_documenter函数代码示例发布时间:2022-05-27
下一篇:
Python autodoc.add_documenter函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap