abc-classroom.template

abcclassroom.template.add_assignment_to_readme(path_to_readme, assignment)[source]
abcclassroom.template.copy_assignment_files(config, template_path, release_dir)[source]

Copy all of the files from the course_materials/release directory for the assignment into the template repo directory.

Parameters
  • config (ordered dictionary) – Config file returned by get_config() that contains paths to the course directory, github organization and other custom options

  • template_path (Pathlib Path object) – Absolute path to the template repository where the assignment files will be copied

  • release_dir (Path object) – Path to the released assignment directory

abcclassroom.template.copy_extra_files(config, template_repo, assignment)[source]

Copy any extra files that exist the extra_files directory

Parameters
  • config (Path) – Path to the config.yml file??

  • template_repo (Path object ?) – Path to the template repo that you wish to copy files over to. ??

  • assignment (string) – Name of the assignment that you want to copy files over for.

abcclassroom.template.create_or_update_remote(template_repo_path, organization, repo_name, token)[source]

Push template repo to github creating a new repository or update the repo’s contents

Parameters
  • template_repo_path (string) – The path to the template repo on your local computer.

  • organization (string) – The name of the organization where your GitHub Classroom lives.

  • repo_name (string) – The name of the template repository to create on GitHub

  • token (github token) – Used to authenticate with GitHub via the API. Created by running abc-init

abcclassroom.template.create_template(assignment_name, mode='fail', push_to_github=False, custom_message=False)[source]

Classroom package function that creates or updates an assignment template repository. Implementation of both the new_template and update_template console scripts (which perform the same basic functions but with different command line arguments and defaults).

Creates an assignment entry in the config file if one does not already exist.

Parameters
  • push_to_github (boolean) – True if you want to push to GH

  • mode (merge, fail) –

  • message (custom) – True if you want to push to github.

  • assignment_name (string) – name of the assignment

abcclassroom.template.create_template_dir(config, assignment, mode='fail')[source]

Creates a new directory in template_dir that will become the template repository for the assignment. If directory exists and mode is merge, do nothing. If directory exists and mode is delete, remove contents but leave .git directory.

abcclassroom.template.new_update_template(args)[source]

Command line function that creates or updates an assignment template repository. Implementation of both the new_template and update_template console scripts (which perform the same basic functions but with different command line arguments and defaults).

Creates an assignment entry in the config file if one does not already exist.

Parameters

args (command line arguments) –