Skip to content

Commit

Permalink
Merge pull request #1 from Bloodmallet/python_module
Browse files Browse the repository at this point in the history
Make this project a python module
  • Loading branch information
Bloodmallet authored Jan 30, 2018
2 parents c0c61f6 + 882ec00 commit e806d5c
Show file tree
Hide file tree
Showing 7 changed files with 2,830 additions and 2,793 deletions.
11 changes: 11 additions & 0 deletions .gitignore
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 removed __init__.py
Empty file.
22 changes: 22 additions & 0 deletions setup.py
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',
)
4 changes: 4 additions & 0 deletions simc_support/__init__.py
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
270 changes: 135 additions & 135 deletions simc_checks.py → simc_support/simc_checks.py
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
Loading

0 comments on commit e806d5c

Please sign in to comment.