Files
finplan/disp.py

34 lines
1.1 KiB
Python

################################################################################
class FP:
def __repr__(self):
str=f"<{self.__class__.__name__}("
for k, v in self.__dict__.items():
if isinstance(v, (bytes, bytearray)):
str += f"{k}=<bytes>, "
elif k == "thumbnail":
str += f"{k}=<base64>, "
# skip internal state
elif k == "_sa_instance_state":
continue
else:
str += f"{k}={v!r}, "
str=str.rstrip(", ") + ")>"
return str
class FP_VAR(FP):
""" Var class is a simple 'struct' to keep data per variable to display
Created just to avoid using python list/dicts intermixed, and be able to consistently use
dot-notation of fields
"""
def __init__(self, label, varname, display='', cl='col-sm-auto', datevarname='', opts=None ):
### Var Attributes -- note, simple class, no methods ###
self.label=label
self.varname=varname
self.display=display
self.cl=cl
self.datevarname=datevarname
self.opts=opts
return