From 79035ea7e636fd541241896c0727fca301f9d407 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubom=C3=ADr=20Sedl=C3=A1=C5=99?= Date: Wed, 1 Jun 2016 14:05:49 +0200 Subject: [PATCH] [media-split] Add code documentation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add a docstring to MediaSplitter class explaining what it does and how to use it. Signed-off-by: Lubomír Sedlář --- pungi/media_split.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pungi/media_split.py b/pungi/media_split.py index a39cd3c5..9bc74dda 100644 --- a/pungi/media_split.py +++ b/pungi/media_split.py @@ -53,6 +53,15 @@ def convert_file_size(size, block_size=2048): class MediaSplitter(object): + """ + MediaSplitter splits files so that they fit on a media of given size. + + Each file added to the spliter has a size in bytes that will be rounded to + the nearest multiple of block size. If the file is sticky, it will be + included on each disk. The files will be on disks in the same order they + are added; there is no re-ordering. The number of disk is thus not the + possible minimum. + """ def __init__(self, media_size, compose=None): self.media_size = convert_media_size(media_size) self.files = [] # to preserve order