12. Module Reference

This chapter contains all the documentation auto-generated from the source code. It is probably not terribly useful for reading through, but may be useful as a searchable reference.

12.1. piwheels.master

12.2. piwheels.transport

12.3. piwheels.protocols

12.4. piwheels.master.tasks

12.5. piwheels.master.states

12.6. piwheels.master.ranges

12.7. piwheels.master.db

12.8. piwheels.master.cloud_gazer

12.9. piwheels.master.the_oracle

12.10. piwheels.master.seraph

12.11. piwheels.master.the_architect

12.12. piwheels.master.slave_driver

12.13. piwheels.master.mr_chase

12.14. piwheels.master.file_juggler

12.15. piwheels.master.big_brother

12.16. piwheels.master.the_secretary

12.17. piwheels.master.the_scribe

12.18. piwheels.slave

12.19. piwheels.slave.builder

12.20. piwheels.initdb

Contains the functions that make up the piw-initdb script.

piwheels.initdb.main(args=None)[source]

This is the main function for the piw-initdb script. It creates the piwheels database required by the master or, if it already exists, upgrades it to the current version of the application.

piwheels.initdb.detect_users(conn, test_user)[source]

Test that the user for conn is a cluster superuser (so we can drop and create anything we want in the database), and that test_user (which will be granted limited rights to various objects for the purposes of the piw-master script) exists and is not a cluster superuser.

piwheels.initdb.detect_version(conn)[source]

Detect the version of the database. This is typically done by reading the contents of the configuration table, but before that was added we can guess a couple of versions based on what tables exist (or don’t). Returns None if the database appears uninitialized, and raises RuntimeError is the version is so ancient we can’t do anything with it.

piwheels.initdb.get_connection(dsn)[source]

Return an SQLAlchemy connection to the specified dsn or raise RuntimeError if the database doesn’t exist (the administrator is expected to create the database before running this script).

piwheels.initdb.get_script(version=None)[source]

Generate the script to get the database from version (the result of detect_version()) to the current version of the software. If version is None, this is simply the contents of the sql/create_piwheels.sql script. Otherwise, it is a concatenation of various update scripts.

piwheels.initdb.parse_statements(script)[source]

This is an extremely crude statement splitter for PostgreSQL’s dialect of SQL. It understands --comments, "quoted identifiers", 'string literals' and $delim$ extended strings $delim$, but not E'\escaped strings' or /* C-style comments */. If you start using such things in the update scripts, you’ll need to extend this function to accommodate them.

It returns a generator which yields individiual statements from script, delimited by semi-colon terminators.

12.21. piwheels.importer

12.22. piwheels.remove