Пример #1
0
    def import_files(self, files):
        # Create the new files, and update the thumnail_index with any new files
        import_time = datetime.now().strftime('%Y-%m-%d %H:%M:%S')
        new_files = filter(None, (File.create_from_file(path, import_time) for path in files))
        for f in new_files:
            self.thumbnail_index[f.md5] = self.thumbnails.Add(f.as_bitmap())

        # If there are any new files we need to re layout the thumbnailGrid
        if len(new_files) > 0:
            self.update_thumbnails()
            self.update_tags()
            self.preview = new_files[0].md5

        return new_files
Пример #2
0
    def import_files(self, files):
        # Create the new files, and update the thumnail_index with any new files
        import_time = datetime.now().strftime('%Y-%m-%d %H:%M:%S')
        new_files = filter(None, (File.create_from_file(path, import_time)
                                  for path in files))
        for f in new_files:
            self.thumbnail_index[f.md5] = self.thumbnails.Add(f.as_bitmap())

        # If there are any new files we need to re layout the thumbnailGrid
        if len(new_files) > 0:
            self.update_thumbnails()
            self.update_tags()
            self.preview = new_files[0].md5

        return new_files