-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from Bloodmallet/python_module
Make this project a python module
- Loading branch information
Showing
7 changed files
with
2,830 additions
and
2,793 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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Compiled python modules. | ||
*.pyc | ||
|
||
# Setuptools distribution folder. | ||
/dist/ | ||
|
||
# Python egg metadata, regenerated from source files by setuptools. | ||
/*.egg-info | ||
|
||
# build directory from adding installing in local dev | ||
/build/ |
File renamed without changes.
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,22 @@ | ||
#!/usr/bin/env python | ||
|
||
from setuptools import setup | ||
|
||
def readme(): | ||
with open('README.txt') as f: | ||
return f.read() | ||
|
||
setup(name='simc_support', | ||
version='1.0', | ||
author='Bloodmallet(EU)', | ||
author_email='[email protected]', | ||
description='This package offers some World of Warcraft related ingame data regularly used for simulations and some basic input test for standard values of SimulationCraft.', | ||
long_description=readme(), | ||
url='https://github.com/Bloodmallet/simc_support', | ||
packages=['simc_support'], | ||
package_data={ | ||
"": ["*.txt", ], | ||
}, | ||
python_requires='>3.5', | ||
license='GNU GENERAL PUBLIC LICENSE', | ||
) |
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,4 @@ | ||
__all__ = [ "simc_checks", "wow_lib" ] | ||
|
||
from . import simc_checks | ||
from . import wow_lib |
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,135 +1,135 @@ | ||
# -*- coding: utf-8 -*- | ||
## Lib to check simc_options input values | ||
|
||
|
||
## | ||
## @brief Gets all fight styles. | ||
## | ||
## @return The fight styles. | ||
## | ||
def get_fight_styles(): | ||
return ( | ||
"patchwerk", | ||
"lightmovement", | ||
"heavymovement", | ||
"hecticaddcleave", | ||
"beastlord", | ||
"helterskelter" | ||
) | ||
|
||
|
||
## | ||
## @brief Gets the profiles of the current addon. | ||
## | ||
## @return The profiles. | ||
## | ||
def get_profiles(): | ||
return ( | ||
"PR" | ||
"T19", | ||
"T20", | ||
"T21" | ||
) | ||
|
||
|
||
## | ||
## @brief Gets the tiers for the current addon | ||
## | ||
## @return The tiers. | ||
## | ||
def get_tiers(): | ||
return ( | ||
"19", | ||
"20", | ||
"21" | ||
) | ||
|
||
|
||
## | ||
## @brief Validates the input fight style. | ||
## | ||
## @param fight_styles The fight style like in SimC options | ||
## | ||
## @return True if fight_style matches predetermined SimC-styles | ||
## | ||
def is_fight_style(fight_styles): | ||
fight_style_list = get_fight_styles() | ||
for fight_style in fight_styles: | ||
if not type(fight_style) is str: | ||
return False | ||
if not fight_style.lower() in fight_style_list: | ||
return False | ||
return True | ||
|
||
|
||
## | ||
## @brief Determines if iteration is a number as a string and greater than | ||
## 5000. | ||
## | ||
## @param iterations The iterations | ||
## | ||
## @return True if iterations is string and greater than 5000, False | ||
## otherwise. | ||
## | ||
def is_iteration(iterations): | ||
if type(iterations) is str: | ||
if int(iterations) >= 5000: | ||
return True | ||
return False | ||
|
||
|
||
## | ||
## @brief Determines if profile is a valid input based on simc profiles. | ||
## | ||
## @param profile The profile | ||
## | ||
## @return True if profile matches simc profiles, False otherwise. | ||
## | ||
def is_profile(profile): | ||
for base_profile in get_profiles(): | ||
if profile.lower() == base_profile.lower(): | ||
return True | ||
return False | ||
|
||
|
||
## | ||
## @brief Determines if target error is string and < 0.5 and >= 0.0. | ||
## | ||
## @param target_error The target error | ||
## | ||
## @return True if target error is string and < 0.5 and >= 0.0, False | ||
## otherwise. | ||
## | ||
def is_target_error(target_error): | ||
if type(target_error) is str: | ||
if 0.5 >= float(target_error) >= 0.0: | ||
return True | ||
return False | ||
|
||
|
||
## | ||
## @brief Determines if threads is useable for simc. | ||
## | ||
## @param threads The threads | ||
## | ||
## @return True if threads, False otherwise. | ||
## | ||
def is_threads(threads): | ||
if type(threads) == str: | ||
if threads == "" or int(threads) > 0: | ||
return True | ||
return False | ||
|
||
|
||
## | ||
## @brief Determines if tier number matches the current (addon) available tiers. | ||
## | ||
## @param tier_number The tier number | ||
## | ||
## @return True if tier number, False otherwise. | ||
## | ||
def is_tier_number(tier_number): | ||
if type(tier_number) == str: | ||
if tier_number in get_tiers(): | ||
return True | ||
return False | ||
# -*- coding: utf-8 -*- | ||
## Lib to check simc_options input values | ||
|
||
|
||
## | ||
## @brief Gets all fight styles. | ||
## | ||
## @return The fight styles. | ||
## | ||
def get_fight_styles(): | ||
return ( | ||
"patchwerk", | ||
"lightmovement", | ||
"heavymovement", | ||
"hecticaddcleave", | ||
"beastlord", | ||
"helterskelter" | ||
) | ||
|
||
|
||
## | ||
## @brief Gets the profiles of the current addon. | ||
## | ||
## @return The profiles. | ||
## | ||
def get_profiles(): | ||
return ( | ||
"PR" | ||
"T19", | ||
"T20", | ||
"T21" | ||
) | ||
|
||
|
||
## | ||
## @brief Gets the tiers for the current addon | ||
## | ||
## @return The tiers. | ||
## | ||
def get_tiers(): | ||
return ( | ||
"19", | ||
"20", | ||
"21" | ||
) | ||
|
||
|
||
## | ||
## @brief Validates the input fight style. | ||
## | ||
## @param fight_styles The fight style like in SimC options | ||
## | ||
## @return True if fight_style matches predetermined SimC-styles | ||
## | ||
def is_fight_style(fight_styles): | ||
fight_style_list = get_fight_styles() | ||
for fight_style in fight_styles: | ||
if not type(fight_style) is str: | ||
return False | ||
if not fight_style.lower() in fight_style_list: | ||
return False | ||
return True | ||
|
||
|
||
## | ||
## @brief Determines if iteration is a number as a string and greater than | ||
## 5000. | ||
## | ||
## @param iterations The iterations | ||
## | ||
## @return True if iterations is string and greater than 5000, False | ||
## otherwise. | ||
## | ||
def is_iteration(iterations): | ||
if type(iterations) is str: | ||
if int(iterations) >= 5000: | ||
return True | ||
return False | ||
|
||
|
||
## | ||
## @brief Determines if profile is a valid input based on simc profiles. | ||
## | ||
## @param profile The profile | ||
## | ||
## @return True if profile matches simc profiles, False otherwise. | ||
## | ||
def is_profile(profile): | ||
for base_profile in get_profiles(): | ||
if profile.lower() == base_profile.lower(): | ||
return True | ||
return False | ||
|
||
|
||
## | ||
## @brief Determines if target error is string and < 0.5 and >= 0.0. | ||
## | ||
## @param target_error The target error | ||
## | ||
## @return True if target error is string and < 0.5 and >= 0.0, False | ||
## otherwise. | ||
## | ||
def is_target_error(target_error): | ||
if type(target_error) is str: | ||
if 0.5 >= float(target_error) >= 0.0: | ||
return True | ||
return False | ||
|
||
|
||
## | ||
## @brief Determines if threads is useable for simc. | ||
## | ||
## @param threads The threads | ||
## | ||
## @return True if threads, False otherwise. | ||
## | ||
def is_threads(threads): | ||
if type(threads) == str: | ||
if threads == "" or int(threads) > 0: | ||
return True | ||
return False | ||
|
||
|
||
## | ||
## @brief Determines if tier number matches the current (addon) available tiers. | ||
## | ||
## @param tier_number The tier number | ||
## | ||
## @return True if tier number, False otherwise. | ||
## | ||
def is_tier_number(tier_number): | ||
if type(tier_number) == str: | ||
if tier_number in get_tiers(): | ||
return True | ||
return False |
Oops, something went wrong.