opzet.object module
basic object for the program.
-
class Object[source]
Bases: builtins.dict
basic Object on which the rest of the program is based.
-
all(zelf, item='', **kwargs)[source]
-
allowed(zelf, origin)[source]
-
clear(zelf)[source]
clear the ready state.
-
clone(zelf)[source]
cloned object, with only the proper keys used.
-
dated(zelf)[source]
retrieve the creation time of an object.
-
days(zelf)[source]
get the number of days relative to the object’s creation time.
-
define(zelf, name, value)[source]
set a attribute on this object.
-
display(zelf, keys)[source]
-
filedate(zelf)[source]
timestamp of related filename.
-
filedatetime(zelf)[source]
timestamp of related filename.
-
filename(zelf, name)[source]
-
files(zelf, path, item='')[source]
-
find(zelf, item)[source]
-
first(zelf, prefix, item='')[source]
-
get_fn(zelf)[source]
-
highest(zelf)[source]
-
json(zelf, names=[], **kwargs)[source]
JSON string representation of this object.
-
last(zelf, prefix, item='')[source]
-
load(zelf, path='')[source]
load a JSON file into this object.
-
lowest(zelf)[source]
-
names(zelf)[source]
skip the unwanted keys e.g those that start with a “_”.
-
notwanted(zelf, notwant)[source]
whether an object is not desired.
-
path(zelf)[source]
-
period(zelf, nrdays=1)[source]
-
prepare(zelf, path)[source]
create JSON ready to be saved to disk.
-
pretty(zelf, names=[])[source]
nice formatted JSON string of this object.
-
read(zelf, path)[source]
read the JSON file from disk.
-
ready(zelf)[source]
signal to ready state.
-
register(zelf, cmnd, func)[source]
callback type with corresponding callback function.
-
remove(zelf, name)[source]
-
represent(zelf)[source]
-
root(zelf)[source]
-
save(zelf, name='', workdir='')[source]
save JSON to disk.
-
search(zelf, item)[source]
search all attribute names.
args[0] = “attribute name to search for”
>>> from opzet.object import Object
>>> object = Object()
>>> object.data = "test"
>>> object.search("da")
['data']
-
selected(zelf)[source]
list of desired objects.
-
selector(zelf, want=[])[source]
see if this objects has the desired attributes.
-
show(zelf)[source]
list of key,value pairs.
-
signature(zelf, data='')[source]
signature of the data contained in this object.
-
slice(zelf, names=[])[source]
take a slice of the Object.
-
sync(zelf, path='')[source]
sync JSON to disk.
-
timed(zelf)[source]
retrieve the creation time of an object.
-
urled(zelf)[source]
url of the Object’s file so that it can be retrieved when API server is running.
-
verify(zelf, data, signature)[source]
-
wait(zelf, sec=180.0)[source]
wait for ready state.
-
wanted(zelf, want)[source]
whether an object is desired.
-
words(zelf)[source]
get the arguments of the txt attribute.
-
location(depth=1)[source]
-
plugname(depth=1)[source]
-
pretty(a)[source]
-
smooth(a)[source]