-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7ffe1fd
commit 54decee
Showing
14 changed files
with
128 additions
and
73 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
pyrez[docs]>=1.0.4,<2 | ||
pyrez[docs]>=1.0.5,<2 |
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
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 |
---|---|---|
@@ -1,19 +1,21 @@ | ||
#!/usr/bin/env python | ||
# -*- coding: utf-8 -*- | ||
|
||
from datetime import datetime | ||
__author__ = "Luis (Lugg) Gustavo" | ||
__author_email__ = "[email protected]" | ||
__copyright__ = "2018-{}, {}".format(datetime.utcnow().year, __author__) | ||
__build__ = 0x010004 | ||
__description__ = "An open-source wrapper for Hi-Rez Studios API (Paladins, Realm Royale, and Smite), written in Python" | ||
__build__ = 0x010005 | ||
__description__ = "An open-source wrapper for Hi-Rez Studios API (Paladins, Realm Royale, and Smite), written in Python." | ||
__license__ = "MIT" | ||
__package_name__ = "pyrez" | ||
__url__ = "https://pyrez.readthedocs.io/en/stable" | ||
__version__ = "1.0.4" #'.'.join(map(str, (1, 0, 4))) | ||
__version__ = "1.0.5" #'.'.join(map(str, (1, 0, 5))) | ||
__title__ = "{}-{}".format(__package_name__.capitalize(), __version__) | ||
version = __version__ | ||
|
||
from collections import namedtuple | ||
version_info = namedtuple("VersionInfo", "major minor micro releaselevel serial")(major=1, minor=0, micro=4, releaselevel="final", serial=0) | ||
version_info = namedtuple("VersionInfo", "major minor micro releaselevel serial")(major=1, minor=0, micro=5, releaselevel="final", serial=0) | ||
|
||
__all__ = ( | ||
"__title__", | ||
|
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
Empty file.
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,46 @@ | ||
#!/usr/bin/env python | ||
# -*- coding: utf-8 -*- | ||
|
||
def check_python(min_version=(3, 5)): | ||
import sys | ||
from .__version__ import __package_name__ | ||
from datetime import datetime | ||
|
||
if sys.version_info[:2] < min_version and datetime.utcnow().year >= 2020: | ||
print("ERROR: {} requires at least Python {} to run.".format(__package_name__.capitalize(), '.'.join(map(str, (min_version))))) | ||
sys.exit(1) | ||
|
||
def show_version(): | ||
from .__version__ import __package_name__, version_info | ||
|
||
import sys | ||
import platform | ||
import requests | ||
entries = [] | ||
entries.append("- Python v{0.major}.{0.minor}.{0.micro}-{0.releaselevel}".format(sys.version_info)) | ||
entries.append("- {0} v{1.major}.{1.minor}.{1.micro}-{1.releaselevel}".format(__package_name__.capitalize(), version_info)) | ||
|
||
entries.append("- requests v{0.__version__}".format(requests)) | ||
entries.append("- System info: {0.system} {0.release} {0.version}".format(platform.uname())) | ||
print("\n".join(entries)) | ||
|
||
def parse_cli_flags(args): | ||
from .__version__ import __package_name__, __version__ | ||
from argparse import ArgumentParser | ||
|
||
parser = ArgumentParser(prog=__package_name__.capitalize(), usage="%(prog)s [arguments]") | ||
parser.add_argument("--version", "-V", "-v", action="store_true", help="Show %(prog)s's current version") | ||
parser.set_defaults(func=show_version) | ||
|
||
return parser.parse_args(args) | ||
|
||
def main(): | ||
import sys | ||
|
||
cli_flags = parse_cli_flags(sys.argv[1:]) | ||
if cli_flags.version: | ||
show_version() | ||
sys.exit(0) | ||
|
||
if __name__ == "__main__": | ||
main() |
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 was deleted.
Oops, something went wrong.
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