-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(version): Handle PHPP v9/10 Verification Worksheet errors
- Loading branch information
Showing
7 changed files
with
186 additions
and
105 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# -*- coding: utf-8 -*- | ||
# -*- Python Version: 3.7 -*- | ||
|
||
"""Class for managing PHPP Version data.""" | ||
|
||
|
||
class PHPPVersion: | ||
"""Manage the PHPP Version number and language information.""" | ||
|
||
def __init__(self, _number_major: str, _number_minor: str, _language: str): | ||
self.number_major = self.clean_input(_number_major) | ||
self.number_minor = self.clean_input(_number_minor) | ||
self.language = self.clean_input(_language) | ||
|
||
def clean_input(self, _input): | ||
"""Upper, strip, replace spaces.""" | ||
return str(_input).upper().strip().replace(" ", "").replace(".", "_") | ||
|
||
def number(self) -> str: | ||
"""Return the full version number (ie: "9.6", "10.4", etc..)""" | ||
return f"{self.number_major}.{self.number_minor}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.