diff options
Diffstat (limited to 'qolab/file_utils/__init__.py')
-rw-r--r-- | qolab/file_utils/__init__.py | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/qolab/file_utils/__init__.py b/qolab/file_utils/__init__.py index 8d403e8..289ffec 100644 --- a/qolab/file_utils/__init__.py +++ b/qolab/file_utils/__init__.py @@ -10,7 +10,10 @@ def filename2os_fname(fname): In particular replaces Z: <==> /mnt/qol_grp_data and \\ <==> / - Example: Z:\\dir1\\dir2\\file <==> /mnt/qol_grp_data/dir1/dir2/file + Example + ------- + >>> filename2os_fname("Z:\\dir1\\dir2\\file") # when run on Linux + '/mnt/qol_grp_data/dir1/dir2/file' """ if platform.system() == "Windows": fname = re.sub("/mnt/qol_grp_data", "Z:", fname) @@ -25,9 +28,11 @@ def filename2os_fname(fname): def get_runnum(data_dir): r"""Reads, increments data counter and saves it back in the provided `data_dir`. If necessary creates counter file and full path to it. - Examples": - get_runnum('Z:\\Ramsi_EIT\\data\\') - get_runnum('/mnt/qol_grp_data/data') + + Examples + -------- + >>> get_runnum('Z:\\Ramsi_EIT\\data\\') + >>> get_runnum('/mnt/qol_grp_data/data') """ data_dir = filename2os_fname(data_dir) if not os.path.exists(data_dir): |