Skip to content

Commit

Permalink
update candv dependency & tidy up
Browse files Browse the repository at this point in the history
  • Loading branch information
o3bvv committed Oct 18, 2014
1 parent 2b78cef commit 91eb7c9
Show file tree
Hide file tree
Showing 9 changed files with 25 additions and 11 deletions.
4 changes: 3 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
IL-2 FB Difficulty
==================

|Build Status| |Coverage Status| |PyPi package| |PyPi downloads|
|Build Status| |Coverage Status| |PyPi package| |PyPi downloads| |License|

Parser and emitter of difficulty settings for ``IL-2 Forgotten Battles``.

Expand All @@ -14,3 +14,5 @@ Parser and emitter of difficulty settings for ``IL-2 Forgotten Battles``.
:target: http://badge.fury.io/py/il2fb-difficulty/
.. |PyPi downloads| image:: http://img.shields.io/pypi/dm/il2fb-difficulty.svg?style=flat
:target: https://crate.io/packages/il2fb-difficulty/
.. |License| image:: https://img.shields.io/badge/license-LGPLv3-brightgreen.svg?style=flat
:target: http://badge.fury.io/py/il2fb-difficulty/
1 change: 1 addition & 0 deletions il2fb/difficulty/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"""
Convert integer value of game difficulty into dictionary and vice versa.
"""

from collections import OrderedDict
from functools import reduce

Expand Down
1 change: 1 addition & 0 deletions il2fb/difficulty/constants.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*-

from candv import Constants, Values, VerboseConstant, VerboseValueConstant

from .utils import translations
Expand Down
4 changes: 3 additions & 1 deletion il2fb/difficulty/settings/__init__.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
# -*- coding: utf-8 -*-

from candv import ValueConstant
from il2fb.commons import GameVersions
from six import string_types

from il2fb.difficulty.utils import translations, flatten_settings

from .v4_12 import SETTINGS as SETTINGS_4_12


Expand Down Expand Up @@ -31,7 +33,7 @@ def _on_invalid_version():
.format(', '.join(supported_versions)))

if isinstance(value, ValueConstant):
if GameVersions.contains(value.name):
if value.name in GameVersions:
version = value
else:
_on_invalid_version()
Expand Down
1 change: 1 addition & 0 deletions il2fb/difficulty/settings/v4_12.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*-

from collections import OrderedDict

from il2fb.difficulty.constants import PARAMETERS, TABS
Expand Down
7 changes: 4 additions & 3 deletions il2fb/difficulty/utils.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
# -*- coding: utf-8 -*-

import os

from verboselib.factory import TranslationsFactory


_here = os.path.abspath(os.path.dirname(__file__))
__here__ = os.path.abspath(os.path.dirname(__file__))

translations = TranslationsFactory("il2fb-difficulty",
os.path.join(_here, "locale"))
locale_dir = os.path.join(__here__, "locale")
translations = TranslationsFactory("il2fb-difficulty", locale_dir)


def inverse_dict(source):
Expand Down
2 changes: 2 additions & 0 deletions il2fb/difficulty/validators.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
# -*- coding: utf-8 -*-

from six import integer_types

from .utils import translations


_ = translations.ugettext


Expand Down
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
#
# pip install -r requirements.txt

candv>=1.1.0
il2fb-commons>=0.9.2
candv>=1.2.0
il2fb-commons>=0.9.6
six>=1.6.1
stringlike>=0.3.3
verboselib>=0.1.0
12 changes: 8 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
# -*- coding: utf-8 -*-

import os

from setuptools import setup


here = os.path.abspath(os.path.dirname(__file__))
__here__ = os.path.abspath(os.path.dirname(__file__))

README = open(os.path.join(here, 'README.rst')).read()
REQUIREMENTS = [i.strip() for i in open("requirements.txt").readlines()]
README = open(os.path.join(__here__, 'README.rst')).read()
REQUIREMENTS = [
i.strip()
for i in open(os.path.join(__here__, 'requirements.txt')).readlines()
]

setup(
name='il2fb-difficulty',
version='1.1.0',
version='1.1.1',
description="Parser and emitter of difficulty settings for IL-2 FB",
long_description=README,
license='LGPLv3',
Expand Down

0 comments on commit 91eb7c9

Please sign in to comment.