コード例 #1
0
    def test_get_child_file_names__test_files(self):
        from parsefilelib.lib.folder_obj import get_child_file_names

        test_files_dir = self.get_test_folder_path('test_files')
        file_names = get_child_file_names(test_files_dir)

        assert 'simple.py' in file_names
コード例 #2
0
ファイル: folder_obj.py プロジェクト: rhintz42/parsefilelib
    def fetch_child_file_objs(self, folder_path):
        """
        Return the files in this folder

        Note about single_child_mode: This method disregards single child mode
            and will return ALL of the files in this folder
        """
        self.single_child_mode = False
        child_file_names = get_child_file_names(folder_path)
        child_files = []

        for c in child_file_names:
            file_path = '%s%s' %(folder_path, c)
            child_files.append(FileObj(file_path, parent_folder=self))
        
        return child_files