python-lottie  0.6.10+dev4166086
A framework to work with lottie files and telegram animated stickers (tgs)
lottie.objects.base.LottieProp Class Reference

Lottie <-> Python property mapper. More...

Public Member Functions

def __init__ (self, name, lottie, type=float, list=False, cond=None)
 
def get (self, obj)
 Returns the value of the property from a Python object. More...
 
def set (self, obj, value)
 Sets the value of the property from a Python object. More...
 
def load_from_parent (self, lottiedict)
 Returns the value for this property from a JSON dict representing the parent object. More...
 
def load_into (self, lottiedict, obj)
 Loads from a Lottie dict into an object. More...
 
def load (self, lottieval)
 Loads the property from a JSON value. More...
 
def to_dict (self, obj)
 Converts the value of the property as from obj into a JSON value. More...
 
def __repr__ (self)
 
def clone_value (self, value)
 

Public Attributes

 name
 Name of the Python property. More...
 
 lottie
 Name of the Lottie JSON property. More...
 
 type
 Type of the property. More...
 
 list
 Whether the property is a list of self.type. More...
 
 cond
 Condition on when the property is loaded from the Lottie JSON. More...
 

Detailed Description

Lottie <-> Python property mapper.

Definition at line 88 of file base.py.

Constructor & Destructor Documentation

◆ __init__()

def lottie.objects.base.LottieProp.__init__ (   self,
  name,
  lottie,
  type = float,
  list = False,
  cond = None 
)

Definition at line 92 of file base.py.

Member Function Documentation

◆ __repr__()

def lottie.objects.base.LottieProp.__repr__ (   self)

Definition at line 201 of file base.py.

◆ clone_value()

def lottie.objects.base.LottieProp.clone_value (   self,
  value 
)

Definition at line 204 of file base.py.

◆ get()

def lottie.objects.base.LottieProp.get (   self,
  obj 
)

Returns the value of the property from a Python object.

Definition at line 106 of file base.py.

◆ load()

def lottie.objects.base.LottieProp.load (   self,
  lottieval 
)

Loads the property from a JSON value.

Returns
the Python equivalent of the JSON value

Definition at line 137 of file base.py.

◆ load_from_parent()

def lottie.objects.base.LottieProp.load_from_parent (   self,
  lottiedict 
)

Returns the value for this property from a JSON dict representing the parent object.

Returns
The loaded value or None if the property is not in lottiedict

Definition at line 120 of file base.py.

◆ load_into()

def lottie.objects.base.LottieProp.load_into (   self,
  lottiedict,
  obj 
)

Loads from a Lottie dict into an object.

Definition at line 129 of file base.py.

◆ set()

def lottie.objects.base.LottieProp.set (   self,
  obj,
  value 
)

Sets the value of the property from a Python object.

Definition at line 112 of file base.py.

◆ to_dict()

def lottie.objects.base.LottieProp.to_dict (   self,
  obj 
)

Converts the value of the property as from obj into a JSON value.

Parameters
objLottieObject with this property

Definition at line 172 of file base.py.

Member Data Documentation

◆ cond

lottie.objects.base.LottieProp.cond

Condition on when the property is loaded from the Lottie JSON.

Definition at line 104 of file base.py.

◆ list

lottie.objects.base.LottieProp.list

Whether the property is a list of self.type.

See also
PseudoList

Definition at line 102 of file base.py.

◆ lottie

lottie.objects.base.LottieProp.lottie

Name of the Lottie JSON property.

Definition at line 96 of file base.py.

◆ name

lottie.objects.base.LottieProp.name

Name of the Python property.

Definition at line 94 of file base.py.

◆ type

lottie.objects.base.LottieProp.type

Type of the property.

See also
LottieValueConverter, PseudoBool

Definition at line 99 of file base.py.


The documentation for this class was generated from the following file: