Changeset 02c8c50 in flex_extract.git for python/UIOTools.py
- Timestamp:
- Mar 18, 2018, 6:27:28 PM (6 years ago)
- Branches:
- master, ctbto, dev
- Children:
- efdb01a
- Parents:
- 64cf353
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
python/UIOTools.py
r64cf353 r02c8c50 69 69 70 70 suffix: list of strings 71 T ypes of files to manipulatesuch as71 The types of files which should be manipulated such as 72 72 ['grib', 'grb', 'grib1', 'grib2', 'grb1', 'grb2'] 73 73 … … 75 75 <nothing> 76 76 ''' 77 77 78 self.suffix = suffix 79 78 80 return 79 81 80 def listFiles(self, path name, pattern):82 def listFiles(self, path, pattern): 81 83 ''' 82 84 @Description: … … 89 91 Description see class documentation. 90 92 91 path name: string93 path: string 92 94 Directory where to list the files. 93 95 … … 99 101 <nothing> 100 102 ''' 101 #AP pathname zu path ändern 102 #AP is it possible for each possible file extension ? mabye regexx? 103 # Get the absolute path of the pathname parameter 104 pathname = os.path.abspath(pathname) 103 104 # Get the absolute path 105 path = os.path.abspath(path) 105 106 106 107 # Get a list of files in pathname 107 filesInCurDir0 = glob.glob(path name+ '/' + pattern)108 filesInCurDir0 = glob.glob(path + '/' + pattern) 108 109 filesInCurDir = [] 109 110 for f in filesInCurDir0: 110 111 filesInCurDir.append(f.split('/')[-1]) 112 111 113 self.counter = 0 112 114 self.files = [] 113 115 # Traverse through all files 114 116 for file in filesInCurDir: 115 curFile = os.path.join(path name, file)117 curFile = os.path.join(path, file) 116 118 117 119 # Check if it's a normal file or directory
Note: See TracChangeset
for help on using the changeset viewer.