Skip to content

Commit 63a4cd1

Browse files
committed
Move OSFS initialization parameters to the OSFS.__init__ docstring
1 parent 91a57da commit 63a4cd1

1 file changed

Lines changed: 19 additions & 17 deletions

File tree

fs/osfs.py

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -81,22 +81,6 @@
8181
class OSFS(FS):
8282
"""Create an OSFS.
8383
84-
Arguments:
85-
root_path (str or ~os.PathLike): An OS path or path-like object to
86-
the location on your HD you wish to manage.
87-
create (bool): Set to `True` to create the root directory if it
88-
does not already exist, otherwise the directory should exist
89-
prior to creating the ``OSFS`` instance (defaults to `False`).
90-
create_mode (int): The permissions that will be used to create
91-
the directory if ``create`` is `True` and the path doesn't
92-
exist, defaults to ``0o777``.
93-
expand_vars(bool): If `True` (the default) environment variables of
94-
the form $name or ${name} will be expanded.
95-
96-
Raises:
97-
`fs.errors.CreateFailed`: If ``root_path`` does not
98-
exist, or could not be created.
99-
10084
Examples:
10185
>>> current_directory_fs = OSFS('.')
10286
>>> home_fs = OSFS('~/')
@@ -112,7 +96,25 @@ def __init__(
11296
expand_vars=True, # type: bool
11397
):
11498
# type: (...) -> None
115-
"""Create an OSFS instance."""
99+
"""Create an OSFS instance.
100+
101+
Arguments:
102+
root_path (str or ~os.PathLike): An OS path or path-like object
103+
to the location on your HD you wish to manage.
104+
create (bool): Set to `True` to create the root directory if it
105+
does not already exist, otherwise the directory should exist
106+
prior to creating the ``OSFS`` instance (defaults to `False`).
107+
create_mode (int): The permissions that will be used to create
108+
the directory if ``create`` is `True` and the path doesn't
109+
exist, defaults to ``0o777``.
110+
expand_vars(bool): If `True` (the default) environment variables
111+
of the form ``~``, ``$name`` or ``${name}`` will be expanded.
112+
113+
Raises:
114+
`fs.errors.CreateFailed`: If ``root_path`` does not
115+
exist, or could not be created.
116+
117+
"""
116118
super(OSFS, self).__init__()
117119
if isinstance(root_path, bytes):
118120
root_path = fsdecode(root_path)

0 commit comments

Comments
 (0)