Skip to content

Commit

Permalink
Merge pull request #30 from Carreau/isatty
Browse files Browse the repository at this point in the history
Automatically detect if running interactively.
  • Loading branch information
mkandziora committed Dec 1, 2018
2 parents 7dad244 + 7eaffba commit 5e26a7a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion physcraper/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,12 @@ class ConfigObj(object):
* self.ncbi_parser_names_fn: path to 'names.dmp' file, that contains the different ID's
"""

def __init__(self, configfi, interactive=True):
def __init__(self, configfi, interactive=None):
if _DEBUG:
sys.stdout.write("Building config object\n")

if interactive is None:
interactive=sys.stdin.isatty()
debug(configfi)
debug(os.path.isfile(configfi))
assert os.path.isfile(configfi), "file `%s` does not exists" % configfi
Expand Down

0 comments on commit 5e26a7a

Please sign in to comment.