Skip to content

Commit 6ef9896

Browse files
committed
Reformat docstring code
1 parent e338326 commit 6ef9896

1 file changed

Lines changed: 40 additions & 32 deletions

File tree

src/imcflibs/pathtools.py

Lines changed: 40 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -60,53 +60,61 @@ def parse_path(path, prefix=""):
6060
POSIX-style path to a file with a suffix:
6161
6262
>>> parse_path('/tmp/foo/file.suffix')
63-
{'dname': 'foo',
64-
'ext': '',
65-
'fname': 'file',
66-
'full': '/tmp/foo/file',
67-
'basename': 'file',
68-
'orig': '/tmp/foo/file',
69-
'parent': '/tmp/',
70-
'path': '/tmp/foo/'}
63+
{
64+
"dname": "foo",
65+
"ext": "",
66+
"fname": "file",
67+
"full": "/tmp/foo/file",
68+
"basename": "file",
69+
"orig": "/tmp/foo/file",
70+
"parent": "/tmp/",
71+
"path": "/tmp/foo/",
72+
}
7173
7274
7375
POSIX-style path to a directory:
7476
7577
>>> parse_path('/tmp/foo/')
76-
{'dname': 'foo',
77-
'ext': '',
78-
'fname': '',
79-
'full': '/tmp/foo/',
80-
'basename': '',
81-
'orig': '/tmp/foo/',
82-
'parent': '/tmp/',
83-
'path': '/tmp/foo/'}
78+
{
79+
"dname": "foo",
80+
"ext": "",
81+
"fname": "",
82+
"full": "/tmp/foo/",
83+
"basename": "",
84+
"orig": "/tmp/foo/",
85+
"parent": "/tmp/",
86+
"path": "/tmp/foo/",
87+
}
8488
8589
8690
Windows-style path to a file:
8791
8892
>>> parse_path(r'C:\Temp\new\file.ext')
89-
{'dname': 'new',
90-
'ext': '.ext',
91-
'fname': 'file.ext',
92-
'full': 'C:/Temp/new/file.ext',
93-
'basename': 'file',
94-
'orig': 'C:\\Temp\\new\\file.ext',
95-
'parent': 'C:/Temp/',
96-
'path': 'C:/Temp/new/'}
93+
{
94+
"dname": "new",
95+
"ext": ".ext",
96+
"fname": "file.ext",
97+
"full": "C:/Temp/new/file.ext",
98+
"basename": "file",
99+
"orig": "C:\\Temp\\new\\file.ext",
100+
"parent": "C:/Temp",
101+
"path": "C:/Temp/new/",
102+
}
97103
98104
99105
Special treatment for *OME-TIFF* suffixes:
100106
101107
>>> parse_path("/path/to/some/nice.OME.tIf")
102-
{'basename': 'nice',
103-
'dname': 'some',
104-
'ext': '.OME.tIf',
105-
'fname': 'nice.OME.tIf',
106-
'full': '/path/to/some/nice.OME.tIf',
107-
'orig': '/path/to/some/nice.OME.tIf',
108-
'parent': '/path/to/',
109-
'path': '/path/to/some/'}
108+
{
109+
"basename": "nice",
110+
"dname": "some",
111+
"ext": ".OME.tIf",
112+
"fname": "nice.OME.tIf",
113+
"full": "/path/to/some/nice.OME.tIf",
114+
"orig": "/path/to/some/nice.OME.tIf",
115+
"parent": "/path/to/",
116+
"path": "/path/to/some/",
117+
}
110118
"""
111119
path = str(path)
112120
if prefix:

0 commit comments

Comments
 (0)