</item>
</tree>
</synopsis>
- <links type="topic" ui:expanded="yes"
- api:type="function" api:mime="text/x-python"
- groups="constructor" style="linklist">
- <title>Constructors</title>
- </links>
+ <p>Constructor</p>
+ <synopsis><code mime="text/x-python">
+${formatter.to_underscores(node.name).lower()} = ${node.name}(\
+% for property_, ix in zip(node.properties, range(len(node.properties))):
+% if property_.construct or property_.construct_only or property_.writable:
+${property_.name.replace('-', '_')}=value\
+% if ix != len(node.properties) - 1:
+, \
+% endif
+% endif
+% endfor
+)\
+ </code></synopsis>
<links type="topic" ui:expanded="yes"
api:type="function" api:mime="text/x-python"
groups="method" style="linklist">
from mako.runtime import supports_caller
from . import ast
+from .utils import to_underscores
class MallardFormatter(object):
def __init__(self, namespace):
return " / ".join(flags)
+ def to_underscores(self, string):
+ return to_underscores(string)
+
class MallardFormatterC(MallardFormatter):
def format_type(self, type_):
</item>
</tree>
</synopsis>
- <links type="topic" ui:expanded="yes"
- api:type="function" api:mime="text/x-python"
- groups="constructor" style="linklist">
- <title>Constructors</title>
- </links>
+ <p>Constructor</p>
+ <synopsis><code mime="text/x-python">
+repository = Repository() </code></synopsis>
<links type="topic" ui:expanded="yes"
api:type="function" api:mime="text/x-python"
groups="method" style="linklist">