Created
April 8, 2016 12:25
-
-
Save vpodzime/367fe60aa129da1f7daf063eab89baca to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from gi.repository import BlockDev as blockdev | |
blockdev.init() | |
def print_args(*args): | |
print(args) | |
# set print_args() as the logging function | |
blockdev.reinit(None, False, print_args) | |
if __name__ == "__main__": | |
extra = [blockdev.UtilExtraArg.new(opt, val) for opt, val in (("-L", "TEST_LABEL"), ("-v", ""))] | |
blockdev.fs_ext4_mkfs("/dev/loop0", extra) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Of course, it's easy to transform (_args, *_kwargs) into a list of
blockdev.UtilExtraArg
objects which is what we can/will do in the Python GI overrides. So the function will just look like this:fs_ext4_mkfs(device, *args, **kwargs)
with all the magic happening automatically.