From a65ca635cf953ba8ac4b4a1d9fb7378e53bcce27 Mon Sep 17 00:00:00 2001 From: Romain Dorgueil Date: Sat, 17 Jun 2017 10:08:06 +0200 Subject: [PATCH] [fs] adds a defaut to current working directory in open_fs(...). --- bonobo/_api.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bonobo/_api.py b/bonobo/_api.py index 9317e31..cf28a33 100644 --- a/bonobo/_api.py +++ b/bonobo/_api.py @@ -68,7 +68,7 @@ register_api(create_strategy) # Shortcut to filesystem2's open_fs, that we make available there for convenience. @register_api -def open_fs(fs_url, *args, **kwargs): +def open_fs(fs_url=None, *args, **kwargs): """ Wraps :func:`fs.open_fs` function with a few candies. @@ -83,6 +83,10 @@ def open_fs(fs_url, *args, **kwargs): """ from fs import open_fs as _open_fs from os.path import expanduser + from os import getcwd + + if fs_url is None: + fs_url = getcwd() return _open_fs(expanduser(str(fs_url)), *args, **kwargs)