bpo.ui package¶
Submodules¶
bpo.ui.images module¶
- bpo.ui.images.file_entry_add_checksums(entry, path)¶
Find checksum files generated by the sha256sum/sha512sum tools, and if they exist, add them to the “entry” dict. :param entry: dict where the checksum will be added :param path: to the file, with {path}.sha256 and {path}.sha512 files in the same dir
- bpo.ui.images.get_entries(path, reverse=False)¶
Get a sorted list of entries (files, directories) in a given path. :param reverse: order in reverse :returns: list of entries
- bpo.ui.images.get_file_size_human(path)¶
Get human readable size of path
- bpo.ui.images.parse_files_from_disk()¶
Iterate through images on disk and generate an intermediate format using the path info
- bpo.ui.images.write_index(path, template, **context)¶
Write an index.html in the specified path based on the supplied template :param path: full path to the directory for the index.html :param template: template filename :param context: arguments for the template
- bpo.ui.images.write_index_all()¶
- bpo.ui.images.write_index_file_list(path, template)¶
Write the index.html for the file list of one build. Each file in the directory gets metadata attached as it gets passed to the template (file size, checksums). :param path: full path to the directory for the index.html :param template: template filename
- bpo.ui.images.write_index_html()¶
For each directory in the images dir (recursively), write the HTML files. The files are always overwritten.
- bpo.ui.images.write_index_json()¶
Write an index.json file, which can be used by a desktop installer to list and download available images.
Module contents¶
- bpo.ui.commit_link(commit)¶
- bpo.ui.copy_static()¶
Copy the static dir to _html_out, as much in an atomic operation as possible.
- bpo.ui.init()¶
- bpo.ui.log(*args, **kwargs)¶
Write one log message and update the output. Do this after making meaningful changes to the database, e.g. after a job callback was executed. See bpo.db.Log.__init__() for the list of parameters.
- NOTE: Make sure that you have committed all changes to any open
sessions (run session.commit() after doing changes), otherwise you will get a “database is locked” error.
- bpo.ui.log_entries_by_day(session)¶
- Returns:
{“2019-01-01”: [a, b, …], “2019-01-02”: [c, d, …], … } a, b, c, d: bpo.db.Log objects
- bpo.ui.log_image(image, action)¶
Convenience wrapper :param image: bpo.db.Image object
- bpo.ui.log_package(package, action, depend_pkgname=None, commit=None)¶
Convenience wrapper :param package: bpo.db.Package object
- bpo.ui.log_repo_bootstrap(rb, action)¶
- bpo.ui.update(session)¶
Update everything in html_out
- bpo.ui.update_badge(session, pkgs, imgs)¶
Update html_out/badge.svg :param session: return value of bpo.db.session() :param pkgs: return value of bpo.db.get_recent_packages_by_status() :param imgs: return value of bpo.db.get_recent_images_by_status() :returns: one of: “up-to-date”, “failed”, “building”
- bpo.ui.update_index(session, pkgs, imgs, badge_name)¶
Update html_out/index.html :param session: return value of bpo.db.session() :param pkgs: return value of bpo.db.get_recent_packages_by_status() :param imgs: return value of bpo.db.get_recent_images_by_status() :param badge_name: return value of update_badge()