root/galaxy-central/eggs/docutils-0.4-py2.6.egg/docutils/readers/python/pynodes.py @ 3

リビジョン 3, 3.1 KB (コミッタ: kohda, 14 年 前)

Install Unix tools  http://hannonlab.cshl.edu/galaxy_unix_tools/galaxy.html

行番号 
1#! /usr/bin/env python
2
3"""
4:Author: David Goodger
5:Contact: goodger@users.sourceforge.net
6:Revision: $Revision: 1881 $
7:Date: $Date: 2004-03-24 00:21:11 +0100 (Wed, 24 Mar 2004) $
8:Copyright: This module has been placed in the public domain.
9
10"""
11
12from docutils import nodes
13from docutils.nodes import Element, TextElement, Structural, Inline, Part, \
14     Text
15import types
16
17# This is the parent class of all the other pynode classes:
18class PythonStructural(Structural): pass
19
20# =====================
21#  Structural Elements
22# =====================
23
24class module_section(PythonStructural, Element): pass   
25class class_section(PythonStructural, Element): pass
26class class_base(PythonStructural, Element): pass
27class method_section(PythonStructural, Element): pass
28class attribute(PythonStructural, Element): pass
29class function_section(PythonStructural, Element): pass
30class class_attribute_section(PythonStructural, Element): pass
31class class_attribute(PythonStructural, Element): pass
32class expression_value(PythonStructural, Element): pass
33class attribute(PythonStructural, Element): pass
34
35# Structural Support Elements
36# ---------------------------
37
38class parameter_list(PythonStructural, Element): pass
39class parameter_tuple(PythonStructural, Element): pass
40class parameter_default(PythonStructural, TextElement): pass
41class import_group(PythonStructural, TextElement): pass
42class import_from(PythonStructural, TextElement): pass
43class import_name(PythonStructural, TextElement): pass
44class import_alias(PythonStructural, TextElement): pass
45class docstring(PythonStructural, Element): pass
46
47# =================
48#  Inline Elements
49# =================
50
51# These elements cannot become references until the second
52# pass.  Initially, we'll use "reference" or "name".
53
54class object_name(PythonStructural, TextElement): pass
55class parameter_list(PythonStructural, TextElement): pass
56class parameter(PythonStructural, TextElement): pass
57class parameter_default(PythonStructural, TextElement): pass
58class class_attribute(PythonStructural, TextElement): pass
59class attribute_tuple(PythonStructural, TextElement): pass
60
61# =================
62#  Unused Elements
63# =================
64
65# These were part of the model, and maybe should be in the future, but
66# aren't now.
67#class package_section(PythonStructural, Element): pass
68#class module_attribute_section(PythonStructural, Element): pass
69#class instance_attribute_section(PythonStructural, Element): pass
70#class module_attribute(PythonStructural, TextElement): pass
71#class instance_attribute(PythonStructural, TextElement): pass
72#class exception_class(PythonStructural, TextElement): pass
73#class warning_class(PythonStructural, TextElement): pass
74
75
76# Collect all the classes we've written above
77def install_node_class_names():
78    node_class_names = []
79    for name, var in globals().items():
80        if (type(var) is types.ClassType
81            and issubclass(var, PythonStructural) \
82            and name.lower() == name):
83            node_class_names.append(var.tagname or name)
84    # Register the new node names with GenericNodeVisitor and
85    # SpecificNodeVisitor:
86    nodes._add_node_class_names(node_class_names)
87install_node_class_names()
Note: リポジトリブラウザについてのヘルプは TracBrowser を参照してください。