himbeerecouch.database¶
Exceptions
-
himbeerecouch.database.
get_database
()[source]¶ get the database object
Return type: cloudant.Database
-
himbeerecouch.database.
get_processes_code
()[source]¶ get the process code from the database (returned by
get_database()
) This expects documents in the database that look like:{ "type" : "macid_of_rasperry<int>", # i.e. value returned by :func:`himbeere.util.getmacid` "name" : "name of the code", "modules" : { # these are modules used by this local code "name_of_module1" : "<python code>", "name_of_module2" : "<python code>", ... }, "global_modules" : { # these modules will be exported to *all* # code in this database "name_of_global1" : "<python code>", "name_of_global2" : "<python code>" }, "code" : "<python code>" # This is the main module, it *must* include a # `main` function }
Note, all of these are optional. If e.g.
"code"
is omitted, then only"global_modules"
will essentially have any effect as they will be exported to other code in the database.Returns: dict - dictionary of code available in the database