/usr/lib/python2.7/dist-packages/chameleon/nodes.py is in python-chameleon 2.16-4.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 | from .astutil import Node
class UseExternalMacro(Node):
"""Extend external macro."""
_fields = "expression", "slots", "extend"
class Sequence(Node):
"""Element sequence."""
_fields = "items",
def __nonzero__(self):
return bool(self.items)
class Content(Node):
"""Content substitution."""
_fields = "expression", "char_escape", "translate"
class Default(Node):
"""Represents a default value."""
_fields = "marker",
class CodeBlock(Node):
_fields = "source",
class Value(Node):
"""Expression object value."""
_fields = "value",
def __repr__(self):
try:
line, column = self.value.location
except AttributeError:
line, column = 0, 0
return "<%s %r (%d:%d)>" % (
type(self).__name__, self.value, line, column
)
class Substitution(Value):
"""Expression value for text substitution."""
_fields = "value", "char_escape", "default"
default = None
class Boolean(Value):
_fields = "value", "s"
class Negate(Node):
"""Wraps an expression with a negation."""
_fields = "value",
class Element(Node):
"""XML element."""
_fields = "start", "end", "content"
class DictAttributes(Node):
"""Element attributes from one or more Python dicts."""
_fields = "expression", "char_escape", "quote", "exclude"
class Attribute(Node):
"""Element attribute."""
_fields = "name", "expression", "quote", "eq", "space", "filters"
class Start(Node):
"""Start-tag."""
_fields = "name", "prefix", "suffix", "attributes"
class End(Node):
"""End-tag."""
_fields = "name", "space", "prefix", "suffix"
class Condition(Node):
"""Node visited only if some condition holds."""
_fields = "expression", "node", "orelse"
class Identity(Node):
"""Condition expression that is true on identity."""
_fields = "expression", "value"
class Equality(Node):
"""Condition expression that is true on equality."""
_fields = "expression", "value"
class Cache(Node):
"""Cache (evaluate only once) the value of ``expression`` inside
``node``.
"""
_fields = "expressions", "node"
class Cancel(Cache):
pass
class Copy(Node):
_fields = "expression",
class Assignment(Node):
"""Variable assignment."""
_fields = "names", "expression", "local"
class Alias(Assignment):
"""Alias assignment.
Note that ``expression`` should be a cached or global value.
"""
local = False
class Define(Node):
"""Variable definition in scope."""
_fields = "assignments", "node"
class Repeat(Assignment):
"""Iterate over provided assignment and repeat body."""
_fields = "names", "expression", "local", "whitespace", "node"
class Macro(Node):
"""Macro definition."""
_fields = "name", "body"
class Program(Node):
_fields = "name", "body"
class Module(Node):
_fields = "name", "program",
class Context(Node):
_fields = "node",
class Text(Node):
"""Static text output."""
_fields = "value",
class Interpolation(Text):
"""String interpolation output."""
_fields = "value", "braces_required", "translation"
class Translate(Node):
"""Translate node."""
_fields = "msgid", "node"
class Name(Node):
"""Translation name."""
_fields = "name", "node"
class Domain(Node):
"""Update translation domain."""
_fields = "name", "node"
class OnError(Node):
_fields = "fallback", "name", "node"
class UseInternalMacro(Node):
"""Use internal macro (defined inside same program)."""
_fields = "name",
class FillSlot(Node):
"""Fill a macro slot."""
_fields = "name", "node"
class DefineSlot(Node):
"""Define a macro slot."""
_fields = "name", "node"
|