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

Nothing

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

igem_wikisync.wikisync.get_browser_with_cookies()[source]

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, only_validate=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:

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

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

True if successful Exits if fails

igem_wikisync.wikisync.write_upload_map(upload_map: dict, filename='upload_map.yml')[source]

Writes upload map to file.