[unpackfs] add python doc strings

main
Philip 10 years ago committed by Teo Mrnjavac
parent d22e194ee7
commit 82dc4c38f4

@ -32,7 +32,7 @@ from libcalamares import *
class UnpackEntry: class UnpackEntry:
""" """ Extraction routine using rsync.
:param source: :param source:
:param sourcefs: :param sourcefs:
@ -52,7 +52,7 @@ ON_POSIX = 'posix' in sys.builtin_module_names
def list_excludes(destination): def list_excludes(destination):
""" """ List excludes for rsync.
:param destination: :param destination:
:return: :return:
@ -67,7 +67,7 @@ def list_excludes(destination):
def file_copy(source, dest, progress_cb): def file_copy(source, dest, progress_cb):
""" """ Extract given image using rsync.
:param source: :param source:
:param dest: :param dest:
@ -124,7 +124,7 @@ def file_copy(source, dest, progress_cb):
class UnpackOperation: class UnpackOperation:
""" """ Extraction routine using unsquashfs.
:param entries: :param entries:
""" """
@ -133,10 +133,7 @@ class UnpackOperation:
self.entry_for_source = dict((x.source, x) for x in self.entries) self.entry_for_source = dict((x.source, x) for x in self.entries)
def report_progress(self): def report_progress(self):
""" """ Pass progress to user interface """
"""
progress = float(0) progress = float(0)
for entry in self.entries: for entry in self.entries:
if entry.total == 0: if entry.total == 0:
@ -150,8 +147,7 @@ class UnpackOperation:
job.setprogress(progress) job.setprogress(progress)
def run(self): def run(self):
""" """ Extract given image using unsquashfs.
:return: :return:
""" """
@ -192,7 +188,7 @@ class UnpackOperation:
shutil.rmtree(source_mount_path) shutil.rmtree(source_mount_path)
def mount_image(self, entry, imgmountdir): def mount_image(self, entry, imgmountdir):
""" """ Mount given image as loop device.
:param entry: :param entry:
:param imgmountdir: :param imgmountdir:
@ -205,7 +201,7 @@ class UnpackOperation:
"-o", "loop"]) "-o", "loop"])
def unpack_image(self, entry, imgmountdir): def unpack_image(self, entry, imgmountdir):
""" """ Unpacks image.
:param entry: :param entry:
:param imgmountdir: :param imgmountdir:
@ -213,7 +209,7 @@ class UnpackOperation:
""" """
def progress_cb(copied): def progress_cb(copied):
""" """ Copies file to given destination target.
:param copied: :param copied:
""" """
@ -229,22 +225,20 @@ class UnpackOperation:
def run(): def run():
# from globalstorage: rootMountPoint """ Unsquashes given filesystem from given image file.
# from job.configuration:
# the path to where to mount the source image(s) for copying from globalstorage: rootMountPoint
# an ordered list of unpack mappings for image file <-> target dir relative from job.configuration: the path to where to mount the source image(s) for copying
# to rootMountPoint, e.g.: an ordered list of unpack mappings for image file <-> target dir relative
# configuration: to rootMountPoint, e.g.:
# unpack: configuration:
# - source: "/path/to/filesystem.img" unpack:
# sourcefs: "ext4" - source: "/path/to/filesystem.img"
# destination: "" sourcefs: "ext4"
# - source: "/path/to/another/filesystem.sqfs" destination: ""
# sourcefs: "squashfs" - source: "/path/to/another/filesystem.sqfs"
# destination: "" sourcefs: "squashfs"
destination: ""
"""
:return: :return:
""" """

Loading…
Cancel
Save