Wiki
Clone wikiVW DLibrary / 2015 / api / utility
NAME
dlibrary.utility - Used for all other, utility, stuff that can't be placed in one of the other modules.
CLASSES
builtins.BaseException(builtins.object) VSException builtins.object AbstractObservableWithDependencies ObservableCommand ObservableMethod AbstractPropertyClassDecorator AbstractViewModel AbstractXmlFile Convert Event Math ObservableField LinkedObservableField ViewModelList XmlDict XmlFileDefaults XmlFileLists XmlFileVersioning builtins.type(builtins.object) SingletonMeta collections.UserList(collections.abc.MutableSequence) ObservableList LinkedObservableList
class AbstractObservableWithDependencies
methods
def __init__(self, dependant_observables: list=None):
class AbstractPropertyClassDecorator
Abstract base class for class decorators which adds a property to the class.
methods
def __call__(self, cls):
def __init__(self, property_value):
def has_decorator(cls, obj: object):
class AbstractViewModel
descriptors
model
methods
def __init__(self, model: object):
class AbstractXmlFile
Class used for setting up files with properties through decorators. This way, plugins can decide how their xml files will behave by just setting the appropriate decorators, as these settings can be plugin version dependant. Loading will correct xmltodict output, so we can expect always the same things: - If an element has nothing (empty), xmltodict gives back None, we prefer an empty dict. - If an element has only inner text, xmltodict gives back a str, we prefer a dict with #text. So the contents will start with a dict and contains only dicts and lists down the road with no lists in lists!
descriptors
path
methods
def __init__(self, path: str):
def load(self, create_if_not_found: bool=False) -> dict:
def save(self, content: dict):
class Convert
methods
def str2bool(value: str) -> bool:
class Event
methods
def __init__(self):
def raise_event(self, args, *kwargs):
def subscribe(self, handler: <built-in function callable>):
def unsubscribe(self, handler: <built-in function callable>):
class LinkedObservableField
descriptors
field_changed_event
value
methods
def __init__(self, model: dict, key: str):
class LinkedObservableList
descriptors
list_changed_event
list_reordered_event
methods
def __add__(self, other):
def __contains__(self, item):
def __delitem__(self, i):
def __eq__(self, other):
def __ge__(self, other):
def __getitem__(self, i):
def __gt__(self, other):
def __iadd__(self, other):
def __imul__(self, n):
def __init__(self, model_list: list, pack: <built-in function callable>, unpack: <built-in function callable>):
def __iter__(self):
def __le__(self, other):
def __len__(self):
def __lt__(self, other):
def __mul__(self, n):
def __ne__(self, other):
def __radd__(self, other):
def __repr__(self):
def __reversed__(self):
def __rmul__ = mul(self, n):
def __setitem__(self, i, item):
def __subclasshook__(cls, C):
def append(self, item):
def clear(self):
def copy(self):
def count(self, item):
def extend(self, other):
def index(self, item, *args):
def insert(self, i, item):
def pop(self, i=-1):
def remove(self, item):
def resume_events(self):
def reverse(self):
def sort(self, args, *kwds):
def suspend_events(self):
class Math
methods
def float_equal(float_a: float, float_b: float) -> bool:
def point_equal(point_a: tuple, point_b: tuple) -> bool:
class ObservableCommand
descriptors
can_execute_changed_event
methods
def __init__(self, execute: <built-in function callable>, can_execute: <built-in function callable>=None, dependant_observables: list=None):
def can_execute(self):
def execute(self):
class ObservableField
descriptors
field_changed_event
value
methods
def __init__(self, default_value=None):
class ObservableList
descriptors
list_changed_event
list_reordered_event
methods
def __add__(self, other):
def __contains__(self, item):
def __delitem__(self, i):
def __eq__(self, other):
def __ge__(self, other):
def __getitem__(self, i):
def __gt__(self, other):
def __iadd__(self, other):
def __imul__(self, n):
def __init__(self, default_list=None):
def __iter__(self):
def __le__(self, other):
def __len__(self):
def __lt__(self, other):
def __mul__(self, n):
def __ne__(self, other):
def __radd__(self, other):
def __repr__(self):
def __reversed__(self):
def __rmul__ = mul(self, n):
def __setitem__(self, i, item):
def __subclasshook__(cls, C):
def append(self, item):
def clear(self):
def copy(self):
def count(self, item):
def extend(self, other):
def index(self, item, *args):
def insert(self, i, item):
def pop(self, i=-1):
def remove(self, item):
def resume_events(self):
def reverse(self):
def sort(self, args, *kwds):
def suspend_events(self):
class ObservableMethod
descriptors
method_changed_event
methods
def __init__(self, method: <built-in function callable>, dependant_observables: list=None):
def apply(self, *args):
class SingletonMeta
methods
def __call__(cls, *args):
def __delattr__(...):
x.delattr('name') <==> del x.name
def __dir__(...):
dir() -> list specialized dir implementation for types
def __getattribute__(...):
x.getattribute('name') <==> x.name
def __init__(...):
x.init(...) initializes x; see help(type(x)) for signature
def __instancecheck__(...):
instancecheck() -> bool check if an object is an instance
def __prepare__(...):
prepare() -> dict used to create the namespace for the class statement
def __repr__(...):
x.repr() <==> repr(x)
def __setattr__(...):
x.setattr('name', value) <==> x.name = value
def __sizeof__(...):
sizeof() -> int return memory consumption of the type object
def __subclasscheck__(...):
subclasscheck() -> bool check if a class is a subclass
def __subclasses__(...):
subclasses() -> list of immediate subclasses
def mro(...):
mro() -> list return a type's method resolution order
class VSException
descriptors
args
methods
def __delattr__(...):
x.delattr('name') <==> del x.name
def __getattribute__(...):
x.getattribute('name') <==> x.name
def __init__(self, function: str):
def __reduce__(...):
def __repr__(...):
x.repr() <==> repr(x)
def __setattr__(...):
x.setattr('name', value) <==> x.name = value
def __setstate__(...):
def __str__(...):
x.str() <==> str(x)
def with_traceback(...):
Exception.with_traceback(tb) -- set self.traceback to tb and return self.
class ViewModelList
descriptors
add_item
items
new_item
selected_items
methods
def __init__(self, model_list: list, abstract_view_model: <built-in function callable>, create_new_model: <built-in function callable>, can_add_new_model: <built-in function callable>=None, can_add_dependent_property_observables: set={}):
noinspection PyDefaultArgument
class XmlDict
methods
def get_element_keys(element: dict) -> set:
def get_elements(element: dict) -> dict:
class XmlFileDefaults
Decorator to specify default values for items, so they can be applied if no value is present.
methods
def __call__(self, cls):
def __init__(self, defaults: dict):
class XmlFileLists
Decorator to correct the contents of an xml file, so that we got actual lists where we expect them. Else, xmltodict will set different types for it depending on how many times it appears in the file.
methods
def __call__(self, cls):
def __init__(self, lists: set):
class XmlFileVersioning
Decorator to facilitate xml file versioning and to convert to the latest version if needed.
methods
def __call__(self, cls):
def __init__(self, converters: dict):
:type converters: dict {int: callable}, which represents version number and converter from previous version.
FILE
d:\development\vw libraries\dlibrary\dlibrary\utility.py
Updated