Skip to content

Commit

Permalink
Fix flake8
Browse files Browse the repository at this point in the history
  • Loading branch information
avara1986 committed Dec 13, 2019
1 parent ea8fc92 commit 3062d82
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pyms/utils/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,21 @@


def import_from(module: Text, name: Text):

module = __import__(module, fromlist=[name])
return getattr(module, name)


def get_service_name(service_base=SERVICE_BASE, service=""):
return ".".join([service_base, service])


def import_package(package: Text):
return importlib.import_module(package)


def check_package_exists(package_name: Text) -> Union[Exception, bool]:
spec = importlib.util.find_spec(package_name)
if spec is None:
raise PackageNotExists("{package} is not installed. try with pip install -U {package}".format(package=package_name))
raise PackageNotExists(
"{package} is not installed. try with pip install -U {package}".format(package=package_name))
return True

0 comments on commit 3062d82

Please sign in to comment.