fix formatting issues

This commit is contained in:
Robert Kaussow 2019-04-09 10:58:15 +02:00
parent c2397b498a
commit 392aa9308d
3 changed files with 36 additions and 36 deletions

View File

@ -2,7 +2,6 @@
"""Main program.""" """Main program."""
import argparse import argparse
import json
import multiprocessing import multiprocessing
from ansiblelater import LOG, __version__, logger from ansiblelater import LOG, __version__, logger

View File

@ -1,15 +1,14 @@
"""Base methods.""" """Base methods."""
import importlib
import os import os
import sys import sys
import importlib from distutils.version import LooseVersion
import ansible import ansible
from distutils.version import LooseVersion from ansiblelater import settings, utils
from ansiblelater import settings
from ansiblelater import utils
def get_settings(args): def get_settings(args):
""" """
@ -29,21 +28,23 @@ def get_settings(args):
def get_standards(filepath): def get_standards(filepath):
sys.path.append(os.path.abspath(os.path.expanduser(filepath))) sys.path.append(os.path.abspath(os.path.expanduser(filepath)))
try: try:
standards = importlib.import_module('standards') standards = importlib.import_module("standards")
except ImportError as e: except ImportError as e:
utils.sysexit_with_message("Could not import standards from directory %s: %s" % (filepath, str(e))) utils.sysexit_with_message(
"Could not import standards from directory %s: %s" % (filepath, str(e)))
if getattr(standards, "ansible_min_version", None) and \ if getattr(standards, "ansible_min_version", None) and \
LooseVersion(standards.ansible_min_version) > LooseVersion(ansible.__version__): LooseVersion(standards.ansible_min_version) > LooseVersion(ansible.__version__):
utils.sysexit_with_message("Standards require ansible version %s (current version %s). " utils.sysexit_with_message("Standards require ansible version %s (current version %s). "
"Please upgrade ansible." % "Please upgrade ansible." %
(standards.ansible_min_version, ansible.__version__)) (standards.ansible_min_version, ansible.__version__))
if getattr(standards, "ansible_review_min_version", None) and \ if getattr(standards, "ansible_review_min_version", None) and \
LooseVersion(standards.ansible_review_min_version) > LooseVersion( LooseVersion(standards.ansible_review_min_version) > LooseVersion(
utils.get_property("__version__")): utils.get_property("__version__")):
utils.sysexit_with_message("Standards require ansible-later version %s (current version %s). " utils.sysexit_with_message(
"Please upgrade ansible-later." % "Standards require ansible-later version %s (current version %s). "
(standards.ansible_review_min_version, utils.get_property("__version__"))) "Please upgrade ansible-later." %
(standards.ansible_review_min_version, utils.get_property("__version__")))
return standards.standards return standards.standards

View File

@ -1,11 +1,11 @@
#!/usr/bin/env python #!/usr/bin/env python
"""Setup script for the package.""" """Setup script for the package."""
import re
import os
import io import io
from setuptools import find_packages import os
from setuptools import setup import re
from setuptools import find_packages, setup
PACKAGE_NAME = "ansiblelater" PACKAGE_NAME = "ansiblelater"
@ -14,7 +14,7 @@ def get_property(prop, project):
current_dir = os.path.dirname(os.path.realpath(__file__)) current_dir = os.path.dirname(os.path.realpath(__file__))
result = re.search( result = re.search(
r'{}\s*=\s*[\'"]([^\'"]*)[\'"]'.format(prop), r'{}\s*=\s*[\'"]([^\'"]*)[\'"]'.format(prop),
open(os.path.join(current_dir, project, '__init__.py')).read()) open(os.path.join(current_dir, project, "__init__.py")).read())
return result.group(1) return result.group(1)
@ -35,25 +35,25 @@ setup(
url="https://github.com/xoxys/ansible-later", url="https://github.com/xoxys/ansible-later",
license=get_property("__license__", PACKAGE_NAME), license=get_property("__license__", PACKAGE_NAME),
long_description=get_readme(), long_description=get_readme(),
long_description_content_type='text/markdown', long_description_content_type="text/markdown",
packages=find_packages(exclude=["tests", "tests.*"]), packages=find_packages(exclude=["tests", "tests.*"]),
python_requires='>=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,,!=3.4.*', python_requires=">=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,,!=3.4.*",
classifiers=[ classifiers=[
'Development Status :: 5 - Production/Stable', "Development Status :: 5 - Production/Stable",
'Environment :: Console', "Environment :: Console",
'License :: OSI Approved :: MIT License', "License :: OSI Approved :: MIT License",
'Intended Audience :: Developers', "Intended Audience :: Developers",
'Intended Audience :: Information Technology', "Intended Audience :: Information Technology",
'Intended Audience :: System Administrators', "Intended Audience :: System Administrators",
'Natural Language :: English', "Natural Language :: English",
'Operating System :: POSIX', "Operating System :: POSIX",
'Programming Language :: Python :: 2', "Programming Language :: Python :: 2",
'Programming Language :: Python :: 2.7', "Programming Language :: Python :: 2.7",
'Programming Language :: Python :: 3', "Programming Language :: Python :: 3",
'Programming Language :: Python :: 3.5', "Programming Language :: Python :: 3.5",
'Programming Language :: Python :: 3.6', "Programming Language :: Python :: 3.6",
'Programming Language :: Python :: 3.7', "Programming Language :: Python :: 3.7",
'Topic :: Utilities', "Topic :: Utilities",
], ],
include_package_data=True, include_package_data=True,
zip_safe=False, zip_safe=False,
@ -70,8 +70,8 @@ setup(
"anyconfig", "anyconfig",
], ],
entry_points={ entry_points={
'console_scripts': [ "console_scripts": [
'ansible-later = ansiblelater.__main__:main' "ansible-later = ansiblelater.__main__:main"
] ]
}, },
test_suite="tests" test_suite="tests"