Skip to content

Commit

Permalink
Add _is_package
Browse files Browse the repository at this point in the history
  • Loading branch information
di committed Oct 20, 2016
1 parent f5720a5 commit 2e307a1
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions vladiate/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,16 @@ def is_vlad(tup):
hasattr(item, "validators") and not name.startswith('_'))


def _is_package(path):
"""
Is the given path a Python package?
"""
return (
os.path.isdir(path)
and os.path.exists(os.path.join(path, '__init__.py'))
)


def find_vladfile(vladfile, path='.'):
"""
Attempt to locate a vladfile, either explicitly or by searching parent dirs.
Expand Down

0 comments on commit 2e307a1

Please sign in to comment.