kern.thing module
basic package for the program.
-
class Thing[source]
Bases: builtins.dict
basic Thing on which the rest of the program is based.
-
all(zelf, *args, **kwargs)[source]
-
announce(zelf, *args, **kwargs)[source]
Announce a text on all channels of all bots.
args[0] = “text to announce”
>>> import kern.bots
>>> bot = kern.bots.Bot()
>>> bot.announce("hello")
hello
-
by_key(zelf, *args, **kwargs)[source]
-
check_notwanted(zelf, *args, **kwargs)[source]
whether an thing is not desired.
-
check_wanted(zelf, *args, **kwargs)[source]
whether an thing is desired.
-
clear(zelf)[source]
clear the ready state.
-
clone(zelf, *args, **kwargs)[source]
cloned ding, with only the proper keys used.
-
dated(zelf, *args, **kwargs)[source]
retrieve the creation time of an ding.
-
days(zelf, *args, **kwargs)[source]
get the number of days relative to the ding’s creation time.
-
define(zelf, *args, **kwargs)[source]
set a attribute on this ding.
-
display(zelf, *args, **kwargs)[source]
-
filedate(zelf, *args, **kwargs)[source]
timestamp of related filename.
-
filedatetime(zelf, *args, **kwargs)[source]
timestamp of related filename.
-
filename(zelf, *args, **kwargs)[source]
-
find(zelf, *args, **kwargs)[source]
-
first(zelf, *args, **kwargs)[source]
-
get_fn(zelf, *args, **kwargs)[source]
-
get_parsed(zelf, *args, **kwargs)[source]
parse the txt attribute.
-
get_path(zelf, *args, **kwargs)[source]
-
get_root(zelf, *args, **kwargs)[source]
-
get_timed(zelf, *args, **kwargs)[source]
retrieve the creation time of an ding.
-
get_url(zelf, *args, **kwargs)[source]
url of the Thing’s file so that it can be retrieved when API server is running.
-
highest(zelf, *args, **kwargs)[source]
-
json(zelf, *args, **kwargs)[source]
JSON string representation of this ding.
-
last(zelf, *args, **kwargs)[source]
-
load(zelf, *args, **kwargs)[source]
load a JSON file into this ding.
-
lowest(zelf, *args, **kwargs)[source]
-
make_signature(zelf)[source]
signature of the data contained in this ding.
-
names(zelf, *args, **kwargs)[source]
skip the unwanted keys e.g those that start with a “_”.
-
ok(zelf, *args, **kwargs)[source]
signal ok.
-
period(zelf, *args, **kwargs)[source]
-
prepare(zelf, *args, **kwargs)[source]
create JSON ready to be saved to disk.
-
pretty(zelf, *args, **kwargs)[source]
nice formatted JSON string of this ding.
-
read(zelf, *args, **kwargs)[source]
read the JSON file from disk.
-
ready(zelf)[source]
signal to ready state.
-
register(zelf, *args, **kwargs)[source]
callback type with corresponding callback function.
-
remove(zelf, *args, **kwargs)[source]
-
reply(zelf, *args, **kwargs)[source]
send reply to origin.
-
represent(zelf, *args, **kwargs)[source]
-
save(zelf, *args, **kwargs)[source]
save JSON to disk.
-
say(zelf, *args, **kwargs)[source]
-
search(zelf, *args, **kwargs)[source]
search all attribute names.
args[0] = “attribute name to search for”
>>> from kern.thing import Thing
>>> thing = Thing()
>>> thing.data = "test"
>>> thing.search("da")
['data']
-
selected(zelf, *args, **kwargs)[source]
list of desired things.
-
selector(zelf, *args, **kwargs)[source]
see if this things has the desired attributes.
-
show(zelf, *args, **kwargs)[source]
list of key,value pairs.
-
slice(zelf, *args, **kwargs)[source]
take a slice of the Thing.
-
sync(zelf, *args, **kwargs)[source]
sync JSON to disk.
-
wait(zelf, sec=180.0)[source]
wait for ready state.
-
words(zelf, *args, **kwargs)[source]
get the arguments of the txt attribute.