def test_make_file_list_depth_search(self): # Util.make_file_list import sys file_path = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'data/depth_search_test') filename_pattern = 'dummy.gml' # Test with depth_search enabled depth_search = True file_list = Util.make_file_list(file_path, None, filename_pattern, depth_search) self.assertEqual(len(file_list), 2) # Test with depth_search disabled depth_search = False file_list = Util.make_file_list(file_path, None, filename_pattern, depth_search) self.assertEqual(len(file_list), 1)
def __init__(self, configdict, section, produces): Input.__init__(self, configdict, section, produces) # Create the list of files to be used as input self.file_list = Util.make_file_list(self.file_path, None, self.filename_pattern, self.depth_search) log.info("file_list=%s" % str(self.file_list)) if not len(self.file_list): raise Exception('File list is empty!!') self.file_list_done = []
def __init__(self, configdict, section, produces): Input.__init__(self, configdict, section, produces) # Create the list of files to be used as input self.file_list = Util.make_file_list(self.file_path, None, self.filename_pattern, self.depth_search) log.info("file_list=%s" % str(self.file_list)) if not len(self.file_list): raise Exception('File list is empty!!') self.cur_file_path = None self.file_list_done = []
def __init__(self, configdict, section, produces): Input.__init__(self, configdict, section, produces) # path to file or files: can be a dir or files or even multiple, comma separated self.file_path = self.cfg.get('file_path') # The filename pattern according to Python glob.glob self.filename_pattern = self.cfg.get('filename_pattern', '*.[gxGX][mM][lL]') # Recurse into directories ? self.depth_search = self.cfg.get_bool('depth_search', False) # Create the list of files to be used as input self.file_list = Util.make_file_list(self.file_path, None, self.filename_pattern, self.depth_search) log.info("file_list=%s" % str(self.file_list))