logbookgenerator.config package¶
Submodules¶
logbookgenerator.config.constants module¶
constants.py: Constants for the application.
- class logbookgenerator.config.constants.Constants¶
Bases:
objectConstants for the application.
Notes
This class contains constants used throughout the application. By storing constants in a single location, it is easier to manage and update them. Constants should be defined as class attributes and should be named in uppercase with underscores separating words. Constants should use type hints to indicate to the user what type of data they should store.
- ANSWER_ID_DELIMITERS: str = '()'¶
- ANSWER_KEYWORD: str = 'ANSWER'¶
- BLOCK_COMMENT_MIDDLE: str = '*'¶
- BLOCK_COMMENT_START: str = '/**'¶
- CODE_COMMENT_DELIMITER: str = '```'¶
- COMMENT_END: str = '*/'¶
- COURSEWORK_REGEX: str = 'e\\d{2}-coursework-(.*)'¶
- DATE_DATETIME_FORMAT: str = '%Y-%m-%d'¶
- DATE_REGEX_FORMAT: str = '^\\d{4}-\\d{2}-\\d{2}$'¶
- DEFAULT_CONFIG_FILE: Path = PosixPath('config.yaml')¶
- DEFAULT_INPUT_DIRECTORY: Path = PosixPath('weeks')¶
- DEFAULT_LOG_SAVE_PATH: Path = PosixPath('logbookgenerator_log.txt')¶
- DEFAULT_MODULE_CODE: str = 'MTH2008'¶
- DEFAULT_MODULE_NAME: str = 'Scientific Computing'¶
- DEFAULT_OUTPUT_FILE: Path = PosixPath('renders/logbook.md')¶
- DEFAULT_STATEMENT_TEXT: str = 'I confirm that this logbook is entirely my own work and that all references and quotations, from both primary and secondary sources, have been fully identified and properly acknowledged.'¶
- DEFAULT_UNIVERSITY_DEPARTMENT: str = 'School of Engineering and Physical Sciences'¶
- DEFAULT_UNIVERSITY_NAME: str = 'University of Lincoln'¶
- FORBIDDEN_CODE: int = 403¶
- ID_REGEX_FORMAT: str = '^\\d{8}$'¶
- INLINE_ANSWER_COMMENT: str = 'ANSWER \\((\\w+) (\\d+)\\.(\\d+)\\): (.+)'¶
- INLINE_COMMENT_START: str = '/*'¶
- JINJA_DATE_FORMAT: str = '%Y-%m-%d'¶
- LOGGING_CONSOLE_FORMAT: str = '%(message)s'¶
- LOGGING_DATE_FORMAT: str = '[%X]'¶
- LOGGING_LEVEL_CONSOLE_DEFAULT: Literal['CRITICAL', 'ERROR', 'WARNING', 'INFO', 'DEBUG'] = 'INFO'¶
- LOGGING_LEVEL_LOGFILE_DEFAULT: Literal['CRITICAL', 'ERROR', 'WARNING', 'INFO', 'DEBUG'] = 'DEBUG'¶
- LOGGING_LOGFILE_FORMAT: str = '%(asctime)s - %(name)s - %(levelname)s - %(message)s'¶
- LOGGING_TIMESTAMP_FORMAT: str = '%Y-%m-%d_%H-%M-%S'¶
- LOGGING_TRACEBACKS: bool = True¶
- POSSIBLE_LOGGING_LEVELS¶
alias of
Literal[‘CRITICAL’, ‘ERROR’, ‘WARNING’, ‘INFO’, ‘DEBUG’]
- SEMESTER_CHOICES: list[str] = ['Semester A', 'Semester B']¶
- SUCCESS_CODE: int = 200¶
- SUCCESS_TEXT: str = 'OK'¶
- TASK_ANNOTATION¶
alias of
dict[str,str|dict[str,list[tuple[str,str]]]]
- WEEK_ANNOTATION¶
alias of
dict[str,str|dict[Literal[‘lab’, ‘extra’],dict[str,dict[str,str|dict[str,list[tuple[str,str]]]]]]]
- YEAR_REGEX_FORMAT: str = '^\\d{4}$'¶
logbookgenerator.config.paths module¶
paths.py: Contains paths for the application.
- class logbookgenerator.config.paths.Paths¶
Bases:
objectPaths for the application.
Notes
This class contains paths used throughout the application. By storing paths in a single location, it is easier to manage and update them. Paths should be defined as class attributes and should be named in uppercase with underscores separating words. Paths should use type hints to indicate to the user what type of data they should store.
- TEMPLATES_PATH = PosixPath('/tmp/tmp2nxzktha')¶
- temp_dir = PosixPath('/tmp/tmp2nxzktha')¶
- classmethod temporary_clone(directory_to_clone: str) None¶
Create a temporary clone of a directory.
- Parameters:
directory_to_clone (str) – The directory to clone.
- logbookgenerator.config.paths.cleanup_temporary_files() None¶
Cleanup temporary files.
Module contents¶
Config package for the project.