Inspector Code¶
mkdocs_python_classy.inspector
¶
Module to handle all inspection related tasks.
Attribute
¶
Class object to inepct attributes.
Source code in mkdocs_python_classy/inspector.py
repr_value
property
¶
Convert to repr value which is more human readable.
__eq__(obj)
¶
__init__(name, value, classobject, instance_class, attr_code)
¶
Initialize the Class.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name |
str
|
The name of the attribute. |
required |
value |
obj
|
The value of the attribute. |
required |
classobject |
obj
|
The class where the Attribute came from. |
required |
instance_class |
obj
|
The class instance where the Attribute came from. |
required |
attr_code |
str
|
The code as parsed via ast. |
required |
Source code in mkdocs_python_classy/inspector.py
Attributes
¶
Bases: collections.abc.MutableSequence
Class to ensure attributes are added following mro order.
Source code in mkdocs_python_classy/inspector.py
__delitem__(key)
¶
__getitem__(key)
¶
__init__()
¶
__len__()
¶
__setitem__(key, value)
¶
Clean and verify before setting.
Source code in mkdocs_python_classy/inspector.py
Inspector
¶
Inspector Class aggregates all of the relevant KlassInspector instances.
Source code in mkdocs_python_classy/inspector.py
__init__(strategy, base_classes_str, module_info, urls, libraries)
¶
Initialize the Class.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
strategy |
list
|
The type of strategy used in this configuration. |
required |
base_classes_str |
str
|
The dotted_path of the Class in question. |
required |
module_info |
list
|
The list of modules to check for the base class from. |
required |
urls |
dict
|
The urls associated with all of the classes. |
required |
libraries |
list
|
A list of library paths to be interested in. |
required |
Source code in mkdocs_python_classy/inspector.py
get_all_klasses()
¶
Dynamically find all classes in scope.
Source code in mkdocs_python_classy/inspector.py
get_url(module_str, base_class_str, name)
¶
Toggle the url based on the strategy.
Source code in mkdocs_python_classy/inspector.py
KlassInspector
¶
Inspector object to inspect a class.
Source code in mkdocs_python_classy/inspector.py
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 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 | |
__init__(klasses, dotted_path)
¶
Initialize the Class.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
klasses |
list
|
List of classes in dotted_path format. |
required |
dotted_path |
str
|
The class in questions dotted_path. |
required |
Source code in mkdocs_python_classy/inspector.py
get_attributes()
¶
Get the attributes of the class.
Source code in mkdocs_python_classy/inspector.py
get_children()
¶
Get children.
Source code in mkdocs_python_classy/inspector.py
get_direct_ancestors()
¶
get_klass()
¶
get_klass_mro()
¶
Get the class inheritance order or MRO.
Source code in mkdocs_python_classy/inspector.py
get_methods()
¶
Get the callable methods.
Source code in mkdocs_python_classy/inspector.py
get_page_url()
¶
get_unavailable_methods()
¶
Get the unavailable methods of the class.
Source code in mkdocs_python_classy/inspector.py
Method
¶
Bases: Attribute
Class object to inepct methods.
Source code in mkdocs_python_classy/inspector.py
__init__(*args, **kwargs)
¶
code()
¶
line_number()
¶
params_string()
¶
Get the string value of the parameters.