pep8 fixes for subiquity/ui/mount.py

This commit is contained in:
Ryan Harper 2018-05-24 14:03:55 -05:00
parent 999e313b3c
commit 51d97b482c
1 changed files with 6 additions and 3 deletions

View File

@ -35,6 +35,7 @@ class _MountEditor(StringEditor):
OTHER = object()
LEAVE_UNMOUNTED = object()
class MountSelector(WidgetWrap):
def __init__(self, mountpoint_to_devpath_mapping):
opts = []
@ -47,7 +48,7 @@ class MountSelector(WidgetWrap):
first_opt = i
opts.append((mnt, True, mnt))
else:
opts.append(("%-*s (%s)"%(max_len, mnt, devpath), False))
opts.append(("%-*s (%s)" % (max_len, mnt, devpath), False))
if first_opt is None:
first_opt = len(opts)
opts.append((_('other'), True, OTHER))
@ -64,14 +65,16 @@ class MountSelector(WidgetWrap):
def _showhide_other(self, show):
if show and not self._other_showing:
self._w.contents.append((Padding(Columns([(1, Text("/")), self._other]), left=4), self._w.options('pack')))
self._w.contents.append(
(Padding(Columns([(1, Text("/")), self._other]), left=4),
self._w.options('pack')))
self._other_showing = True
elif not show and self._other_showing:
del self._w.contents[-1]
self._other_showing = False
def _select_mount(self, sender, value):
self._showhide_other(value==OTHER)
self._showhide_other(value == OTHER)
if value == OTHER:
self._w.focus_position = 1