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

Python python._pseudo_parse_arglist函数代码示例

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

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



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

示例1: handle_signature

 def handle_signature(self, sig, signode):
     """Handle IDL signature lines"""
     m = idl_sig_re.match(sig)
     if not m:
         self.env.app.warn("Signature did not match for {}".format(sig))
         raise ValueError("Signature did not match!")
     pro_or_function, name, arglist = m.groups()
     
     # Add a prefix for function/program
     if self.display_prefix:
         signode += addnodes.desc_annotation(self.display_prefix,
                                             self.display_prefix)
     
     signode += addnodes.desc_annotation(self.objtype, self.objtype)
     
     # Register the full name of the program
     signode['fullname'] = name
     signode += addnodes.desc_name(name, name)
     
     # Parse the argument list from the signature
     if not arglist and self.objtype == 'function':
         signode += addnodes.desc_parameterlist()
     elif arglist:
         _pseudo_parse_arglist(signode, arglist)
     return (name, '')
开发者ID:alexrudy,项目名称:sphinx-idl,代码行数:25,代码来源:domain.py


示例2: handle_signature

	def handle_signature(self, sig, signode):
		sig = sig.strip()
		if '(' in sig and sig[-1:] == ')':
			prefix, arglist = sig.split('(', 1)
			prefix = prefix.strip()
			arglist = arglist[:-1].strip()
		else:
			prefix = sig
			arglist = None
		if '.' in prefix:
			nameprefix, name = prefix.rsplit('.', 1)
		else:
			nameprefix = None
			name = prefix

		objectname = self.env.temp_data.get('js:object')
		if nameprefix:
		 	if objectname:
				# someone documenting the method of an attribute
				# of the current object? shouldn't happen but
				# who knows...
				nameprefix = objectname + '.' + nameprefix
			fullname = nameprefix + '.' + name

		elif objectname:
			fullname = objectname + '.' + name

		else:
			# just a function or constructor
			objectname = ''
			fullname = name

		signode['object'] = objectname
		signode['fullname'] = fullname

		if self.display_prefix:
			signode += addnodes.desc_annotation(self.display_prefix,
				self.display_prefix)

		if nameprefix:
			 signode += addnodes.desc_addname(nameprefix + '.',
				nameprefix + '.')
		signode += addnodes.desc_name(name, name)
		if self.has_arguments:
			if not arglist:
				signode += addnodes.desc_parameterlist()
			else:
				_pseudo_parse_arglist(signode, arglist)

		class_name = self.options.get('outertype')
		# object belongs to some class or namespace
		if class_name:
			# func_desc = function return type + function name
			func_desc = fullname.split(' ', 1)
			if len(func_desc) > 1:
				fullname = func_desc[0] + ' ' + class_name +\
					'.' + func_desc[1]

		return fullname, nameprefix
开发者ID:povilasb,项目名称:sphinx-js-domain,代码行数:59,代码来源:javascript.py


示例3: parse

def parse(sig):
    m = py_sig_re.match(sig)
    if m is None:
        raise ValueError
    name_prefix, name, arglist, retann = m.groups()
    signode = addnodes.desc_signature(sig, '')
    _pseudo_parse_arglist(signode, arglist)
    return signode.astext()
开发者ID:hagenw,项目名称:sphinx,代码行数:8,代码来源:test_domain_py.py


示例4: handle_signature

    def handle_signature(self, sig_input, signode):
        """Parses out pieces from construct signatures

        Parses out prefix and argument list from construct definition. This is
        assuming that the .NET languages this will support will be in a common
        format, such as::

            Namespace.Class.method(argument, argument, ...)

        The namespace and class will be determined by the nesting of rST
        directives.

        Returns
            Altered :py:data:`signode` with attributes corrected for rST
            nesting/etc
        """
        try:
            sig = self.parse_signature(sig_input.strip())
        except ValueError:
            self.env.warn(self.env.docname,
                          'Parsing signature failed: "{}"'.format(sig_input),
                          self.lineno)
            raise

        prefix = self.env.ref_context.get('dn:prefix', None)

        if prefix is not None:
            sig.prefix = prefix

        signode['object'] = sig.member
        signode['prefix'] = sig.prefix
        signode['fullname'] = sig.full_name()

        # Prefix modifiers
        if self.display_prefix:
            signode += addnodes.desc_annotation(self.display_prefix,
                                                self.display_prefix)
        for prefix in ['public', 'protected', 'static']:
            if prefix in self.options:
                signode += addnodes.desc_annotation(prefix + ' ',
                                                    prefix + ' ')

        # Show prefix only on shorter declarations
        if sig.prefix is not None and not self.has_arguments:
            signode += addnodes.desc_addname(sig.prefix + '.', sig.prefix + '.')

        signode += addnodes.desc_name(sig.member, sig.member)
        if self.has_arguments:
            if not sig.arguments:
                signode += addnodes.desc_parameterlist()
            else:
                # TODO replace this
                _pseudo_parse_arglist(signode, ', '.join(sig.arguments))

        if isinstance(self, DotNetObjectNested):
            return sig.full_name(), sig.full_name()
        return sig.full_name(), sig.prefix
开发者ID:anurse,项目名称:sphinxcontrib-dotnetdomain,代码行数:57,代码来源:dotnetdomain.py


示例5: handle_signature

    def handle_signature(self, sig, signode):
        sig = sig.strip()
        if '(' in sig and sig[-1:] == ')':
            prefix, arglist = sig.split('(', 1)
            prefix = prefix.strip()
            arglist = arglist[:-1].strip()
        else:
            prefix = sig
            arglist = None
        if '.' in prefix:
            nameprefix, name = prefix.rsplit('.', 1)
        else:
            nameprefix = None
            name = prefix

        objectname = self.env.temp_data.get('mongodb:object')
        if nameprefix:
            if objectname:
                # someone documenting the method of an attribute of the current
                # object? shouldn't happen but who knows...
                nameprefix = objectname + '.' + nameprefix
            fullname = nameprefix + '.' + name
        elif objectname:
            fullname = objectname + '.' + name
        else:
            # just a function or constructor
            objectname = ''
            fullname = name

        signode['object'] = objectname
        signode['fullname'] = fullname

        if self.display_prefix:
            signode += addnodes.desc_annotation(self.display_prefix,
                                                self.display_prefix)

        if nameprefix:
            if nameprefix in conf['suppress-prefix']:
                pass
            else:
                nameprefix += '.'
                for prefix in conf['suppress-prefix']:
                    if nameprefix.startswith(prefix):
                        nameprefix = nameprefix[len(prefix)+1:]
                        break

                signode += addnodes.desc_addname(nameprefix, nameprefix)
                nameprefix[:-1]

        signode += addnodes.desc_name(name, name)
        if self.has_arguments:
            if not arglist:
                signode += addnodes.desc_parameterlist()
            else:
                _pseudo_parse_arglist(signode, arglist)
        return fullname, nameprefix
开发者ID:MarkTseng,项目名称:docs-tools,代码行数:56,代码来源:mongodb.py


示例6: handle_signature

    def handle_signature(self, sig, signode):
        if self.display_prefix:
            signode += addnodes.desc_annotation(self.display_prefix, self.display_prefix)

        fullname, _, args = sig.partition('(')
        modname, name = fullname.split('::')
        args = args[:-1]
        signode += addnodes.desc_name(name, name)
        if isinstance(self, CoffeeFunction):
            _pseudo_parse_arglist(signode, args)
        return fullname
开发者ID:AusIV,项目名称:coffee-sphinx,代码行数:11,代码来源:domain.py


示例7: handle_signature

    def handle_signature(self, sig, signode):
        """Transform a Lasso signature into RST nodes.
        """
        sig = sig.strip().replace('  ', ' ').replace(' ::', '::').replace(':: ', '::')
        if '(' in sig:
            if ')::' in sig:
                sig, returntype = sig.rsplit('::', 1)
            else:
                returntype = None
            prefix, arglist = sig.split('(', 1)
            prefix = prefix.strip()
            arglist = arglist[:-1].strip().replace(' =', '=').replace('= ', '=')
        else:
            if '::' in sig:
                sig, returntype = sig.rsplit('::', 1)
            else:
                returntype = None
            prefix = sig
            arglist = None
        if '->' in prefix:
            objectprefix, name = prefix.rsplit('->', 1)
            objectprefix += '->'
        else:
            objectprefix = None
            name = prefix

        objectname = self.env.ref_context.get('ls:object')
        if objectprefix:
            fullname = objectprefix + name
        elif objectname:
            fullname = objectname + '->' + name
        else:
            objectname = ''
            fullname = name

        signode['object'] = objectname
        signode['fullname'] = fullname

        sig_prefix = self.get_signature_prefix(sig)
        if sig_prefix:
            signode += addnodes.desc_annotation(sig_prefix, sig_prefix)
        if objectprefix:
            signode += addnodes.desc_addname(objectprefix, objectprefix)

        signode += addnodes.desc_name(name, name)
        if self.needs_arglist():
            if arglist:
                _pseudo_parse_arglist(signode, arglist)
            else:
                signode += addnodes.desc_parameterlist()
            if returntype:
                signode += addnodes.desc_returns(returntype, returntype)
        return fullname, objectprefix
开发者ID:Lemma1,项目名称:MINAMI,代码行数:53,代码来源:lassodomain.py


示例8: handle_signature

    def handle_signature(self, sig, signode):
        # type: (unicode, addnodes.desc_signature) -> Tuple[unicode, unicode]
        """Breaks down construct signatures

        Parses out prefix and argument list from construct definition. The
        namespace and class will be determined by the nesting of domain
        directives.
        """
        sig = sig.strip()
        if '(' in sig and sig[-1:] == ')':
            member, arglist = sig.split('(', 1)
            member = member.strip()
            arglist = arglist[:-1].strip()
        else:
            member = sig
            arglist = None
        # If construct is nested, prefix the current prefix
        prefix = self.env.ref_context.get('js:object', None)
        mod_name = self.env.ref_context.get('js:module')
        name = member
        try:
            member_prefix, member_name = member.rsplit('.', 1)
        except ValueError:
            member_name = name
            member_prefix = ''
        finally:
            name = member_name
            if prefix and member_prefix:
                prefix = '.'.join([prefix, member_prefix])
            elif prefix is None and member_prefix:
                prefix = member_prefix
        fullname = name
        if prefix:
            fullname = '.'.join([prefix, name])

        signode['module'] = mod_name
        signode['object'] = prefix
        signode['fullname'] = fullname

        if self.display_prefix:
            signode += addnodes.desc_annotation(self.display_prefix,
                                                self.display_prefix)
        if prefix:
            signode += addnodes.desc_addname(prefix + '.', prefix + '.')
        elif mod_name:
            signode += addnodes.desc_addname(mod_name + '.', mod_name + '.')
        signode += addnodes.desc_name(name, name)
        if self.has_arguments:
            if not arglist:
                signode += addnodes.desc_parameterlist()
            else:
                _pseudo_parse_arglist(signode, arglist)
        return fullname, prefix
开发者ID:nvmanh,项目名称:plant,代码行数:53,代码来源:javascript.py


示例9: handle_signature

    def handle_signature(self, sig, signode):
        """Transform a Python signature into RST nodes.

        Return (fully qualified name of the thing, classname if any).

        If inside a class, the current class name is handled intelligently:
        * it is stripped from the displayed name if present
        * it is added to the full name (return value) if not present
        """
        name_prefix = None
        name = sig
        arglist = None
        retann = None

        # determine module and class name (if applicable), as well as full name
        modname = self.options.get(
            'module', self.env.temp_data.get('py:module'))
        classname = self.env.temp_data.get('py:class')

        fullname = name

        signode['module'] = modname
        signode['class'] = classname
        signode['fullname'] = fullname

        sig_prefix = self.get_signature_prefix(sig)
        if sig_prefix:
            signode += addnodes.desc_annotation(sig_prefix, sig_prefix)

        if name_prefix:
            signode += addnodes.desc_addname(name_prefix, name_prefix)

        anno = self.options.get('annotation')

        signode += addnodes.desc_name(name, name)
        if not arglist:
            if self.needs_arglist():
                # for callables, add an empty parameter list
                signode += addnodes.desc_parameterlist()
            if retann:
                signode += addnodes.desc_returns(retann, retann)
            if anno:
                signode += addnodes.desc_annotation(' ' + anno, ' ' + anno)
            return fullname, name_prefix

        _pseudo_parse_arglist(signode, arglist)
        if retann:
            signode += addnodes.desc_returns(retann, retann)
        if anno:
            signode += addnodes.desc_annotation(' ' + anno, ' ' + anno)
        return fullname, name_prefix
开发者ID:10173677,项目名称:jenkins-job-builder,代码行数:51,代码来源:yaml.py


示例10: handle_signature

    def handle_signature(self, sig, signode):
        if self.display_prefix:
            signode += addnodes.desc_annotation(self.display_prefix, self.display_prefix)

        fullname, paren, args = sig.partition('(')
        modname, name = fullname.split(MOD_SEP)
        classname = self.env.temp_data.get('autodoc:class')
        if classname and name.startswith(classname):
            name = name[len(classname):]
        args = args[:-1]
        signode += addnodes.desc_name(name, name)
        if isinstance(self, CoffeeFunction):
            _pseudo_parse_arglist(signode, args)
        return fullname
开发者ID:Lemma1,项目名称:MINAMI,代码行数:14,代码来源:domain.py


示例11: handle_signature

    def handle_signature(self, sig, signode):
        # type: (unicode, addnodes.desc_signature) -> Tuple[unicode, unicode]
        sig = sig.strip()
        if '(' in sig and sig[-1:] == ')':
            prefix, arglist = sig.split('(', 1)
            prefix = prefix.strip()
            arglist = arglist[:-1].strip()
        else:
            prefix = sig
            arglist = None
        if '.' in prefix:
            nameprefix, name = prefix.rsplit('.', 1)
        else:
            nameprefix = None
            name = prefix

        objectname = self.env.ref_context.get('js:object')
        if nameprefix:
            if objectname:
                # someone documenting the method of an attribute of the current
                # object? shouldn't happen but who knows...
                nameprefix = objectname + '.' + nameprefix
            fullname = nameprefix + '.' + name
        elif objectname:
            fullname = objectname + '.' + name
        else:
            # just a function or constructor
            objectname = ''
            fullname = name

        signode['object'] = objectname
        signode['fullname'] = fullname

        if self.display_prefix:
            signode += addnodes.desc_annotation(self.display_prefix,
                                                self.display_prefix)
        if nameprefix:
            signode += addnodes.desc_addname(nameprefix + '.', nameprefix + '.')
        signode += addnodes.desc_name(name, name)
        if self.has_arguments:
            if not arglist:
                signode += addnodes.desc_parameterlist()
            else:
                _pseudo_parse_arglist(signode, arglist)
        return fullname, nameprefix
开发者ID:JelteF,项目名称:sphinx,代码行数:45,代码来源:javascript.py


示例12: handle_signature

  def handle_signature(self, sig, signode):
    sig = sig.strip()
    if '(' in sig and sig[-1:] == ')':
      prefix, arglist = sig.split('(', 1)
      prefix = prefix.strip()
      arglist = arglist[:-1].strip()
    else:
      prefix = sig
      arglist = None
    if re.search(separators, prefix):
      separator = re.findall(separators, prefix)[-1]
      nameprefix, name = prefix.rsplit(separator, 1)
    else:
      separator = None
      nameprefix = None
      name = prefix

    objectname = self.env.temp_data.get('lua:object')
    if nameprefix:
      if objectname:
        nameprefix = objectname + '.' + nameprefix
      fullname = nameprefix + separator + name
    elif objectname:
      fullname = objectname + '.' + name
    else:
      objectname = ''
      fullname = name

    signode['object'] = objectname
    signode['fullname'] = fullname

    if self.display_prefix:
      signode += addnodes.desc_annotation(self.display_prefix,
                        self.display_prefix)
    if nameprefix:
      signode += addnodes.desc_addname(nameprefix + separator, nameprefix + separator)
    signode += addnodes.desc_name(name, name)
    if self.has_arguments:
      if not arglist:
        signode += addnodes.desc_parameterlist()
      else:
        _pseudo_parse_arglist(signode, arglist)
    return fullname, nameprefix
开发者ID:xyang94,项目名称:lpopup,代码行数:43,代码来源:luadomain.py


示例13: handle_signature

    def handle_signature(self, sig, signode):
        sig = sig.strip()
        if "(" in sig and sig[-1:] == ")":
            prefix, arglist = sig.split("(", 1)
            prefix = prefix.strip()
            arglist = arglist[:-1].strip()
        else:
            prefix = sig
            arglist = None
        if "." in prefix:
            nameprefix, name = prefix.rsplit(".", 1)
        else:
            nameprefix = None
            name = prefix

        objectname = self.env.temp_data.get("mongodb:object")
        if nameprefix:
            if objectname:
                # someone documenting the method of an attribute of the current
                # object? shouldn't happen but who knows...
                nameprefix = objectname + "." + nameprefix
            fullname = nameprefix + "." + name
        elif objectname:
            fullname = objectname + "." + name
        else:
            # just a function or constructor
            objectname = ""
            fullname = name

        signode["object"] = objectname
        signode["fullname"] = fullname

        if self.display_prefix:
            signode += addnodes.desc_annotation(self.display_prefix, self.display_prefix)
        if nameprefix:
            signode += addnodes.desc_addname(nameprefix + ".", nameprefix + ".")
        signode += addnodes.desc_name(name, name)
        if self.has_arguments:
            if not arglist:
                signode += addnodes.desc_parameterlist()
            else:
                _pseudo_parse_arglist(signode, arglist)
        return fullname, nameprefix
开发者ID:simon-chan,项目名称:docs,代码行数:43,代码来源:mongodb_domain.py


示例14: handle_signature

    def handle_signature(self, sig, signode):
        """Transform a Python signature into RST nodes.

        Return (fully qualified name of the thing, classname if any).

        If inside a class, the current class name is handled intelligently:
        * it is stripped from the displayed name if present
        * it is added to the full name (return value) if not present
        """
        # determine module and class name (if applicable), as well as full name
        from sphinx import addnodes

        r = re.compile(r"(\w+)\s+([^\(]+)\s*\((.*)\)")
        m = r.match(sig)
        if m is None:
            raise ValueError

        method, name, arglist = m.groups()

        modname = self.options.get(
            'module', self.env.temp_data.get('py:module'))
        add_module = True
        classname = ''
        fullname = "%s %s" % (method, name)

        signode['module'] = modname
        signode['class'] = classname
        signode['fullname'] = fullname

        signode += addnodes.desc_name(fullname, fullname)

        if not arglist:
            return fullname, ''

        from sphinx.domains.python import _pseudo_parse_arglist

        _pseudo_parse_arglist(signode, arglist)
        return fullname, ''
开发者ID:frm-system,项目名称:frm,代码行数:38,代码来源:autoapi.py


示例15: handle_signature

    def handle_signature(self, sig, signode):
        sig = sig.strip()
        prefix = sig
        arglist = None
        nameprefix = None
        name = prefix

        objectname = self.env.temp_data.get('make:object')
        if nameprefix:
            if objectname:
                # someone documenting the method of an attribute of the current
                # object? shouldn't happen but who knows...
                nameprefix = objectname + '.' + nameprefix
            fullname = nameprefix + '.' + name
        elif objectname:
            fullname = objectname + '.' + name
        else:
            # just a function or constructor
            objectname = ''
            fullname = name

        signode['object'] = objectname
        signode['fullname'] = fullname

        if self.display_prefix:
            signode += addnodes.desc_annotation(self.display_prefix,
                                                self.display_prefix)
        if nameprefix:
            signode += addnodes.desc_addname(nameprefix + '.', nameprefix + '.')
        signode += addnodes.desc_name(name, name)
        if self.has_arguments:
            if not arglist:
                signode += addnodes.desc_parameterlist()
            else:
                _pseudo_parse_arglist(signode, arglist)
        return fullname, nameprefix
开发者ID:cyborginstitute,项目名称:taskfile,代码行数:36,代码来源:make_domain.py


示例16: handle_signature

    def handle_signature(self, sig, signode):
        """Transform a Lua signature into RST nodes.

        Return (fully qualified name of the thing, classname if any).

        If inside a class, the current class name is handled intelligently:
        * it is stripped from the displayed name if present
        * it is added to the full name (return value) if not present
        """
        m = lua_sig_re.match(sig)
        if m is None:
            raise ValueError
        name_prefix, name, argstart, arglist, argend, retann = m.groups()

        # determine module and class name (if applicable), as well as full name
        modname = self.options.get("module", self.env.temp_data.get("lua:module"))
        classname = self.env.temp_data.get("lua:class")
        if classname:
            add_module = False
            if name_prefix and name_prefix.startswith(classname):
                fullname = name_prefix + name
                # class name is given again in the signature
                name_prefix = name_prefix[len(classname) :].lstrip(".:")
            elif name_prefix:
                # class name is given in the signature, but different
                # (shouldn't happen)
                fullname = classname + "." + name_prefix + name
            else:
                # class name is not given in the signature
                fullname = classname + ":" + name
        else:
            add_module = True
            if name_prefix:
                classname = name_prefix.rstrip(".:")
                fullname = name_prefix + name
            else:
                classname = ""
                fullname = name

        signode["module"] = modname
        signode["class"] = classname
        signode["fullname"] = fullname

        sig_prefix = self.get_signature_prefix(sig)
        if sig_prefix:
            signode += addnodes.desc_annotation(sig_prefix, sig_prefix)

        if name_prefix:
            signode += addnodes.desc_addname(name_prefix, name_prefix)
        # exceptions are a special case, since they are documented in the
        # 'exceptions' module.
        elif add_module and self.env.config.add_module_names:
            modname = self.options.get("module", self.env.temp_data.get("lua:module"))
            if modname and modname != "exceptions":
                nodetext = modname + "."
                signode += addnodes.desc_addname(nodetext, nodetext)

        anno = self.options.get("annotation")

        signode += addnodes.desc_name(name, name)
        if not arglist:
            if self.needs_arglist():
                # for callables, add an empty parameter list
                listnode = lua_desc_parameterlist(argstart, argend)
                signode += listnode
            if retann:
                signode += addnodes.desc_returns(retann, retann)
            if anno:
                signode += addnodes.desc_annotation(" " + anno, " " + anno)
            return fullname, name_prefix

        _pseudo_parse_arglist(signode, arglist)
        if retann:
            signode += addnodes.desc_returns(retann, retann)
        if anno:
            signode += addnodes.desc_annotation(" " + anno, " " + anno)
        return fullname, name_prefix
开发者ID:jd28,项目名称:sphinx-lua,代码行数:77,代码来源:lua.py


示例17: _handle_signature

  def _handle_signature(self, cid, lineno, sig, signode):
    # type: (str, addnodes.desc_signature) -> Tuple[str, str]
    """Transform a Python signature into RST nodes.

    Return (fully qualified name of the thing, classname if any).

    If inside a class, the current class name is handled intelligently:
    * it is stripped from the displayed name if present
    * it is added to the full name (return value) if not present

    This is the xml string result of signode, whitespace is not
    equivalent for readability.
    <desc_signature
        class=""
        first="False"
        fullname="com.google.fonts/check/all_glyphs_have_codepoints"
        module="fontbakery.profiles.cmap"
        >
            <desc_annotation
                xml:space="preserve">FontBakeryCheck </desc_annotation>
            <desc_addname
                xml:space="preserve">fontbakery.profiles.cmap.</desc_addname>
            <desc_name
                xml:space="preserve">com_google_fonts_check_all_glyphs_have_codepoints</desc_name>
            <desc_parameterlist
                xml:space="preserve">
                    <desc_parameter xml:space="preserve">ttFont</desc_parameter>
            </desc_parameterlist>
      </desc_signature>

    """
    m = py_sig_re.match(sig)
    if m is None:
      # this is the immediate fail!!!
      raise ValueError
    prefix, name, arglist, retann = m.groups()
    # print('prefix, name, arglist, retann =', prefix, name, arglist, retann)
    # > prefix, name, arglist, retann = None com_google_fonts_check_all_glyphs_have_codepoints ttFont None

    # determine module and class name (if applicable), as well as full name
    modname = self.options.get('module', self.env.ref_context.get('py:module'))
    classname = self.env.ref_context.get('py:class')
    if classname:
      add_module = False
      if prefix and (prefix == classname or
               prefix.startswith(classname + ".")):
        fullname = prefix + name
        # class name is given again in the signature
        prefix = prefix[len(classname):].lstrip('.')
      elif prefix:
        # class name is given in the signature, but different
        # (shouldn't happen)
        fullname = classname + '.' + prefix + name
      else:
        # class name is not given in the signature
        fullname = classname + '.' + name
    else:
      add_module = True
      if prefix:
        classname = prefix.rstrip('.')
        fullname = prefix + name
      else:
        classname = ''
        fullname = name


    signode['module'] = modname
    signode['class'] = classname
    signode['fullname'] = fullname
    signode.attributes['lineno'] = lineno


    #sig_prefix = self.get_signature_prefix(sig)
    #if sig_prefix:
    #  signode += addnodes.desc_annotation(sig_prefix, sig_prefix)


    if prefix:
      signode += addnodes.desc_addname(prefix, prefix)
    elif add_module and self.env.config.add_module_names:
      if modname and modname != 'exceptions':
        # exceptions are a special case, since they are documented in the
        # 'exceptions' module.
        #nodetext = modname + ' ID: '
        #signode += addnodes.desc_addname(nodetext, nodetext)
        pass


    signode += addnodes.desc_name(name, cid)
    if arglist:
      _pseudo_parse_arglist(signode, arglist)
    else:
      if self.needs_arglist():
        # for callables, add an empty parameter list
        signode += addnodes.desc_parameterlist()


    if retann:
      signode += addnodes.desc_returns(retann, retann)

#.........这里部分代码省略.........
开发者ID:googlefonts,项目名称:fontbakery,代码行数:101,代码来源:profile.py



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Python python.PyClassmember类代码示例发布时间:2022-05-27
下一篇:
Python code.LiteralIncludeReader类代码示例发布时间: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