Simple
sangfroid.value.Simple(*args)
#
Bases: sangfroid.value.value.Value
Abstract superclass of Values which are based directly on Python
builtin types.
Issue
Subclasses of Simple should coerce freely to and from their
builtin types, but they don't. See issue
#14.
Properties
our_type (type): the Python type we're based on.
Source code in sangfroid/value/value.py
16 17 18 19 20 21 22 23 24 25 26 27 | |
is_animated
property
writable
#
Whether the value is animated.
timeline
property
writable
#
Our timeline, showing how our value changes over time.
If we're not animated, the timeline will be empty.
Timeline objects hold no state of their own except a reference back to
their parent Value. So this call constructs a new Timeline instance
every time.
as_python_expression()
#
A Python expression which could be passed to the constructor of this class in order to recreate this value.
Used by etc/pick-and-mix-to-layers.py.
Source code in sangfroid/value/value.py
285 286 287 288 289 290 291 292 | |
from_tag(tag)
classmethod
#
Given a Beautiful Soup tag, returns an instance of an appropriate
subclass of Value, representing it.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
tag
|
bs4.Tag
|
the Beautiful Soup tag. |
required |
Raises:
| Type | Description |
|---|---|
KeyError
|
if there's no known subclass of |
ValueError
|
if the tag is animated, but not marked with a type. |
Source code in sangfroid/value/value.py
304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 | |