client package

Submodules

client.client_callback module

client.client_webhook module

class client.client_webhook.ClientWebhook(commit_data=None)[source]

Bases: object

build_multipart_source(file_key, book)[source]
clear_commit_directory_in_cdn(s3_commit_key)[source]
create_build_log(commit_id, commit_message, commit_url, compare_url, job, pusher_username, repo_name, repo_owner)[source]
Parameters:
  • commit_id (string) –
  • commit_message (string) –
  • commit_url (string) –
  • compare_url (string) –
  • job (TxJob) –
  • pusher_username (string) –
  • repo_name (string) –
  • repo_owner (string) –
Return dict:
download_repo(commit_url, repo_dir)[source]

Downloads and unzips a git repository from Github or git.door43.org

Parameters:
  • commit_url (str|unicode) – The URL of the repository to download
  • repo_dir (str|unicode) – The directory where the downloaded file should be unzipped
Returns:

None

get_converter_module(job)[source]
Parameters:job (TxJob) –
Return TxModule:
 
get_linter_module(job)[source]
Parameters:job (TxJob) –
Return TxModule:
 
get_repo_files(commit_url, repo_name)[source]
get_unique_job_id()[source]
Return string:
process_webhook()[source]
send_payload_to_converter(payload, converter)[source]
Parameters:
  • payload (dict) –
  • converter (TxModule) –
Return bool:
send_payload_to_linter(payload, linter)[source]
Parameters:
  • payload (dict) –
  • linter (TxModule) –
Return bool:
send_request_to_converter(job, converter)[source]
Parameters:
  • job (TxJob) –
  • converter (TxModule) –
Return bool:
send_request_to_linter(job, linter, commit_url, extra_payload=None)[source]
Parameters:
  • job (TxJob) –
  • linter (TxModule) –
  • commit_url (string) –
  • extra_payload (dict) –
Return bool:
update_project_json(commit_id, job, repo_name, repo_owner)[source]
Parameters:
  • commit_id (string) –
  • job (TxJob) –
  • repo_name (string) –
  • repo_owner (string) –
Returns:

upload_build_log_to_s3(build_log, s3_commit_key, part=u'')[source]
Parameters:
  • build_log (dict) –
  • s3_commit_key (string) –
  • part (string) –
Returns:

upload_zip_file(commit_id, zip_filepath)[source]

Module contents