Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

member function -> method.

  • Loading branch information...
commit 47b921cfafcbda9e392b9dac466c7b9b58e35a9a 1 parent 952178f
@fredreichbier fredreichbier authored
Showing with 14 additions and 14 deletions.
  1. +12 −12 sphinx_ooc/desc.py
  2. +2 −2 sphinx_ooc/roles.py
View
24 sphinx_ooc/desc.py
@@ -186,16 +186,16 @@ def needs_arglist(self):
return self.desctype.endswith('function')
def get_signature_prefix(self, sig):
- if self.desctype == 'staticmemberfunction':
- return 'static member function '
- elif self.desctype == 'memberfunction':
- return 'member function '
+ if self.desctype == 'staticmethod':
+ return 'static method '
+ elif self.desctype == 'method':
+ return 'method '
return ''
def get_index_text(self, modname, name_cls):
name, cls = name_cls
add_modules = self.env.config.add_module_names
- if self.desctype == 'memberfunction':
+ if self.desctype == 'method':
try:
clsname, methname = name.rsplit(' ', 1)
except ValueError:
@@ -204,10 +204,10 @@ def get_index_text(self, modname, name_cls):
else:
return '%s()' % name
if modname and add_modules:
- return _('%s() (%s/%s member function)') % (methname, modname, clsname)
+ return _('%s() (%s/%s method)') % (methname, modname, clsname)
else:
- return _('%s() (%s member function)') % (methname, clsname)
- elif self.desctype == 'staticmemberfunction':
+ return _('%s() (%s method)') % (methname, clsname)
+ elif self.desctype == 'staticmethod':
try:
clsname, methname = name.rsplit(' ', 1)
except ValueError:
@@ -216,10 +216,10 @@ def get_index_text(self, modname, name_cls):
else:
return '%s()' % name
if modname and add_modules:
- return _('%s() (%s/%s static member function)') % (methname, modname,
+ return _('%s() (%s/%s static method)') % (methname, modname,
clsname)
else:
- return _('%s() (%s static member function)') % (methname, clsname)
+ return _('%s() (%s static method)') % (methname, clsname)
elif self.desctype == 'field':
try:
clsname, attrname = name.rsplit(' ', 1)
@@ -249,8 +249,8 @@ def before_content(self):
directives.register_directive('class', directive_dwim(ClasslikeDesc))
directives.register_directive('cover', directive_dwim(ClasslikeDesc))
-directives.register_directive('memberfunction', directive_dwim(ClassmemberDesc))
-directives.register_directive('staticmemberfunction', directive_dwim(ClassmemberDesc))
+directives.register_directive('method', directive_dwim(ClassmemberDesc))
+directives.register_directive('staticmethod', directive_dwim(ClassmemberDesc))
directives.register_directive('field', directive_dwim(ClassmemberDesc))
View
4 sphinx_ooc/roles.py
@@ -55,7 +55,7 @@ def ooc_xfileref_role(typ, rawtext, text, lineno, inliner, options={}, content=[
# TODO: kicked for generics. aarrrrghhh.
# special target for Python object cross-references
if typ in ('data', 'exc', 'func', 'class', 'const', 'field',
- 'mfunc', 'mod', 'obj', 'cover', 'var'):
+ 'meth', 'mod', 'obj', 'cover', 'var'):
# fix-up parentheses in link title
if titleistarget:
title = title.lstrip('.') # only has a meaning for the target
@@ -111,6 +111,6 @@ def ooc_xfileref_role(typ, rawtext, text, lineno, inliner, options={}, content=[
classes=['xref'])
return [pnode], []
-for role in ('cover', 'class', 'func', 'mfunc', 'field', 'var'):
+for role in ('cover', 'class', 'func', 'meth', 'field', 'var'):
roles.register_local_role(role, ooc_xfileref_role)
BuildEnvironment.descroles = frozenset(set(BuildEnvironment.descroles) | set(('cover',)))
Please sign in to comment.
Something went wrong with that request. Please try again.