コード例 #1
0
    def scan_fs(self):
        fps = Fs.find(
            self.options.path,
            rec=any([self.options.flag_recursive, self.options.flag_flatten]))

        callbacks.progress("Separating files and directories...")
        file_items = filter(os.path.isfile, fps)
        dir_items = filter(os.path.isdir, fps)

        items = file_items
        if self.options.flag_dirsonly or not items:
            items = dir_items

        return map(FilePath, items)
コード例 #2
0
    def scan_fs(self):
        fps = Fs.find(self.options.path,
                      rec=any([self.options.flag_recursive,
                               self.options.flag_flatten]))

        callbacks.progress("Separating files and directories...")
        file_items = filter(os.path.isfile, fps)
        dir_items = filter(os.path.isdir, fps)

        items = file_items
        if self.options.flag_dirsonly or not items:
            items = dir_items

        return map(FilePath, items)