Vega strike Python Modules doc
0.5.1
Documentation of the " Modules " folder of Vega strike
|
Public Member Functions | |
def | __init__ |
def | __repr__ |
def | __getattr__ |
Helper class used by the Bastion() function. You could subclass this and pass the subclass as the bastionclass argument to the Bastion() function, as long as the constructor has the same signature (a get() function and a name for the object).
Definition at line 34 of file Bastion.py.
def __init__ | ( | self, | |
get, | |||
name | |||
) |
Constructor. Arguments: get - a function that gets the attribute value (by name) name - a human-readable name for the original object (suggestion: use repr(object))
Definition at line 44 of file Bastion.py.
References BastionClass._get_, and BastionClass._name_.
def __getattr__ | ( | self, | |
name | |||
) |
Get an as-yet undefined attribute value. This calls the get() function that was passed to the constructor. The result is stored as an instance variable so that the next time the same attribute is requested, __getattr__() won't be invoked. If the get() function raises an exception, this is simply passed on -- exceptions are not cached.
Definition at line 67 of file Bastion.py.
References BastionClass._get_, and Bastion.Bastion().
def __repr__ | ( | self) |
Return a representation string. This includes the name passed in to the constructor, so that if you print the bastion during debugging, at least you have some idea of what it is.
Definition at line 57 of file Bastion.py.
References BastionClass._name_.