Changeset 274f9ef in flex_extract.git for source/python/classes/UioFiles.py
- Timestamp:
- Oct 22, 2018, 11:44:47 AM (6 years ago)
- Branches:
- master, ctbto, dev
- Children:
- db27c09
- Parents:
- 708c667
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
source/python/classes/UioFiles.py
rca867de r274f9ef 61 61 62 62 class UioFiles(object): 63 ''' 64 Class to manipulate files. At initialisation it has the pattern 63 '''Class to manipulate files. At initialisation it has the pattern 65 64 which stores a regular expression pattern for the files, the path 66 65 to the files and the files already. … … 70 69 # -------------------------------------------------------------------------- 71 70 def __init__(self, path, pattern): 72 ''' 73 @Description: 74 Assignes a specific pattern for these files. 71 '''Assignes a specific pattern for these files. 75 72 76 @Input: 77 self: instance of UioFiles 78 Description see class documentation. 73 Parameters 74 ---------- 75 path : :obj:`string` 76 Directory where to list the files. 79 77 80 path: string81 Directory where to list the files.78 pattern : :obj:`string` 79 Regular expression pattern. For example: '\*.grb' 82 80 83 pattern: string84 Regular expression pattern. For example: '*.grb'81 Return 82 ------ 85 83 86 @Return:87 <nothing>88 84 ''' 89 85 … … 98 94 #@profiling.timefn 99 95 def __list_files__(self, path): 100 ''' 101 @Description: 102 Lists all files in the directory with the matching 103 regular expression pattern. 96 '''Lists all files in the directory with the matching 97 regular expression pattern. 104 98 105 @Input: 106 self: instance of UioFiles 107 Description see class documentation. 99 Parameters 100 ---------- 101 path : :obj:`string` 102 Path to the files. 108 103 109 path: string110 Path to the files.104 Return 105 ------ 111 106 112 @Return:113 <nothing>114 107 ''' 115 108 # Get the absolute path … … 124 117 125 118 def __str__(self): 126 ''' 127 @Description: 128 Converts the list of files into a single string. 129 The entries are sepereated by "," sign. 119 '''Converts the list of files into a single string. 120 The entries are sepereated by "," sign. 130 121 131 @Input: 132 self: instance of UioFiles 133 Description see class documentation. 122 Parameters 123 ---------- 134 124 135 @Return: 136 files_string: string 137 The content of the list as a single string. 125 Return 126 ------ 127 files_string : :obj:`string` 128 The content of the list as a single string. 138 129 ''' 139 130 … … 144 135 145 136 def delete_files(self): 146 ''' 147 @Description: 148 Deletes the files. 137 '''Deletes the files. 149 138 150 @Input: 151 self: instance of UioFiles 152 Description see class documentation. 139 Parameters 140 ---------- 153 141 154 @Return: 155 <nothing> 142 Return 143 ------ 144 156 145 ''' 157 146
Note: See TracChangeset
for help on using the changeset viewer.