[Python-checkins] r65200 - in doctools/trunk: doc/markup/desc.rst sphinx/directives/desc.py

georg.brandl python-checkins at python.org
Wed Jul 23 17:18:00 CEST 2008


Author: georg.brandl
Date: Wed Jul 23 17:18:00 2008
New Revision: 65200
Log:
Remove the opcode directive.
Modified:
 doctools/trunk/doc/markup/desc.rst
 doctools/trunk/sphinx/directives/desc.py
Modified: doctools/trunk/doc/markup/desc.rst
==============================================================================
--- doctools/trunk/doc/markup/desc.rst	(original)
+++ doctools/trunk/doc/markup/desc.rst	Wed Jul 23 17:18:00 2008
@@ -205,11 +205,6 @@
 
 .. versionadded:: 0.4
 
-.. directive:: .. opcode:: name
-
- Describes a Python bytecode instruction (this is not very useful for projects
- other than Python itself).
-
 .. directive:: .. cmdoption:: name args, name args, ...
 
 Describes a command line option or switch. Option argument names should be
Modified: doctools/trunk/sphinx/directives/desc.py
==============================================================================
--- doctools/trunk/sphinx/directives/desc.py	(original)
+++ doctools/trunk/sphinx/directives/desc.py	Wed Jul 23 17:18:00 2008
@@ -69,8 +69,6 @@
 return '%s (%s.%s attribute)' % (attrname, module, clsname)
 else:
 return '%s (%s attribute)' % (attrname, clsname)
- elif desctype == 'opcode':
- return '%s (opcode)' % name
 elif desctype == 'cfunction':
 return '%s (C function)' % name
 elif desctype == 'cmember':
@@ -343,21 +341,6 @@
 return name
 
 
-opcode_sig_re = re.compile(r'(\w+(?:\+\d)?)\s*\((.*)\)')
-
-def parse_opcode_signature(signode, sig):
- """Transform an opcode signature into RST nodes."""
- m = opcode_sig_re.match(sig)
- if m is None:
- raise ValueError
- opname, arglist = m.groups()
- signode += addnodes.desc_name(opname, opname)
- paramlist = addnodes.desc_parameterlist()
- signode += paramlist
- paramlist += addnodes.desc_parameter(arglist, arglist)
- return opname.strip()
-
-
 option_desc_re = re.compile(
 r'(/|-|--)([-_a-zA-Z0-9]+)(\s*.*?)(?=,\s+(?:/|-|--)|$)')
 
@@ -405,8 +388,6 @@
 name, clsname = parse_py_signature(signode, sig, desctype, module, env)
 elif desctype in ('cfunction', 'cmember', 'cmacro', 'ctype', 'cvar'):
 name = parse_c_signature(signode, sig, desctype)
- elif desctype == 'opcode':
- name = parse_opcode_signature(signode, sig)
 elif desctype == 'cmdoption':
 optname = parse_option_desc(signode, sig)
 if not noindex:
@@ -510,8 +491,6 @@
 'cmacro',
 'ctype',
 'cvar',
- # the odd one
- 'opcode',
 # for command line options
 'cmdoption',
 # the generic one


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /