igem_wikisync¶
-
igem_wikisync.wikisync.build_and_upload(files, browser, config, upload_map)[source]¶ Replaces URLs in files and uploads changed files.
Parameters: - files – Custom file cache
- browser – mechanicalsoup.StatefulBrowser instance
- config – Configuration for this run
- upload_map – custom upload map
Returns: Dictionary with no. of ‘html’, ‘css’ and ‘js’ files uploaded
-
igem_wikisync.wikisync.cache_files(upload_map, config)[source]¶ Loads filenames into memory, along with setting up appropriate objects to generate URLs and hashes as required.
Parameters: - upload_map – custom upload map
- config – configuration for this run
Returns: cache – dictionary with html, css, js and other file objects
Creates a mechanicalsoup.StatefulBrowser() instance with cookies loaded from file, if exists.
Returns: browser – mechanicalsoup.StatefulBrowser() instance cookiejar: browser cookiejar that can be saved after logging in
-
igem_wikisync.wikisync.get_upload_map()[source]¶ Opens existing upload_map.yml or creates and empty upload map.
Upload map is a dictionary that contains previously uploaded html, css, js and other files, along with their URLs and hashes.
-
igem_wikisync.wikisync.run(team: str, src_dir: str, build_dir: str, year=2020, silence_warnings=False)[source]¶ Runs iGEM-WikiSync and uploads all files to iGEM servers while replacing relative URLs with those on the iGEM server.
- Mandatory Arguments:
- team: iGEM Team Name src_dir: Path to the folder where the source files are present build_dir: Path to the folder where the built files will be stored before uploading
- Optional Arguments:
- year: Subdomain for igem.org. Current year by default. silence_warnings: Broken link warnings are not printed to console if true. The log still contains everything.
Returns: 1 – Incorrect input in function call. 2: Connection problem. 3: Invalid upload map. 4: Failed to write/upload file.
-
igem_wikisync.wikisync.upload_and_write_assets(other_files, browser, upload_map, config)[source]¶ ” Uploads and writes all files and stores URLs in upload_map.
Parameters: - other_files – dictionary containing OtherFile objects
- browser – mechanicalsoup.StatefulBrowser instance
- upload_map – custom upload map
- config – custom configuration options
Returns: Number of files uploaded
Raises: SystemExit on failure