Changeset 02c8c50 in flex_extract.git for python/UIOTools.py


Ignore:
Timestamp:
Mar 18, 2018, 6:27:28 PM (6 years ago)
Author:
Anne Philipp <bscannephilipp@…>
Branches:
master, ctbto, dev
Children:
efdb01a
Parents:
64cf353
Message:

more changes in PEP8 style and slight modifications in coding style and naming. More documentation of functions.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • python/UIOTools.py

    r64cf353 r02c8c50  
    6969
    7070            suffix: list of strings
    71                 Types of files to manipulate such as
     71                The types of files which should be manipulated such as
    7272                ['grib', 'grb', 'grib1', 'grib2', 'grb1', 'grb2']
    7373
     
    7575            <nothing>
    7676        '''
     77
    7778        self.suffix = suffix
     79
    7880        return
    7981
    80     def listFiles(self, pathname, pattern):
     82    def listFiles(self, path, pattern):
    8183        '''
    8284        @Description:
     
    8991                Description see class documentation.
    9092
    91             pathname: string
     93            path: string
    9294                Directory where to list the files.
    9395
     
    99101            <nothing>
    100102        '''
    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)
    105106
    106107        # Get a list of files in pathname
    107         filesInCurDir0 = glob.glob(pathname + '/' + pattern)
     108        filesInCurDir0 = glob.glob(path + '/' + pattern)
    108109        filesInCurDir = []
    109110        for f in filesInCurDir0:
    110111            filesInCurDir.append(f.split('/')[-1])
     112
    111113        self.counter = 0
    112114        self.files = []
    113115        # Traverse through all files
    114116        for file in filesInCurDir:
    115             curFile = os.path.join(pathname, file)
     117            curFile = os.path.join(path, file)
    116118
    117119            # Check if it's a normal file or directory
Note: See TracChangeset for help on using the changeset viewer.
hosted by ZAMG