pep8 fixes for subiquity/ui/spinner.py

This commit is contained in:
Ryan Harper 2018-05-24 14:02:23 -05:00
parent 534c39708c
commit 999e313b3c
1 changed files with 5 additions and 3 deletions

View File

@ -19,7 +19,9 @@ from urwid import (
styles = {
'dots': {
'texts': [t.replace('*', '\N{bullet}') for t in ['|*----|', '|-*---|', '|--*--|', '|---*-|', '|----*|', '|---*-|', '|--*--|', '|-*---|']],
'texts': [t.replace('*', '\N{bullet}')
for t in ['|*----|', '|-*---|', '|--*--|', '|---*-|',
'|----*|', '|---*-|', '|--*--|', '|-*---|']],
'rate': 0.2,
},
'spin': {
@ -28,6 +30,7 @@ styles = {
},
}
class Spinner(Text):
def __init__(self, loop, style='spin', align='center'):
self.loop = loop
@ -38,7 +41,7 @@ class Spinner(Text):
self.handle = None
def _advance(self, sender=None, user_data=None):
self.spin_index = (self.spin_index + 1)%len(self.spin_text)
self.spin_index = (self.spin_index + 1) % len(self.spin_text)
self.set_text(self.spin_text[self.spin_index])
self.handle = self.loop.set_alarm_in(self.rate, self._advance)
@ -51,4 +54,3 @@ class Spinner(Text):
if self.handle is not None:
self.loop.remove_alarm(self.handle)
self.handle = None