devilry.utils.delivery_collection¶
- class devilry.utils.delivery_collection.ArchiveException¶
Bases: exceptions.Exception
Archive exceptions
- devilry.utils.delivery_collection.create_archive_from_assignmentgroups(request, assignmentgroups, file_name, archive_type)¶
Creates an archive of type archive_type, named file_name, containing all the deliveries in each of the assignmentgroups in the list assignmentgroups.
- devilry.utils.delivery_collection.create_archive_from_delivery(request, delivery, archive_type)¶
Creates an archive of type archive_type, named assignment.get_path(), containing all files in the delivery.
- devilry.utils.delivery_collection.iter_archive_deliveries(archive, group_name, directory_prefix, deliveries)¶
Adds files one by one from the list of deliveries into the archive. After writing each file to the archive, the new bytes in the archive is yielded. If a file is bigger than DEVILRY_MAX_ARCHIVE_CHUNK_SIZE, only DEVILRY_MAX_ARCHIVE_CHUNK_SIZE bytes are written before it’s yielded. The returned object is an iterator.
- devilry.utils.delivery_collection.iter_archive_assignmentgroups(archive, assignmentgroups)¶
Creates an archive, adds files delivered by the assignmentgroups and yields the data.
- devilry.utils.delivery_collection.verify_groups_not_exceeding_max_file_size(assignmentgroups)¶
For each assignmentgroups in groups, calls verify_deliveries_not_exceeding_max_file_size(). If the size of a file in a delivery exceeds the settings.DEVILRY_MAX_ARCHIVE_CHUNK_SIZE, an ArchiveException is raised.
- devilry.utils.delivery_collection.verify_deliveries_not_exceeding_max_file_size(deliveries)¶
Goes through all the files in each deliverery, and if the size of a file exceeds the DEVILRY_MAX_ARCHIVE_CHUNK_SIZE, an ArchiveException is raised.