Skip to content

Commit

Permalink
fix trailing whitespace, unused imports
Browse files Browse the repository at this point in the history
  • Loading branch information
airelemental committed Jun 16, 2019
1 parent 5991534 commit 971d5dd
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
7 changes: 3 additions & 4 deletions qui/decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
'''
# pylint: disable=wrong-import-position,import-error

import qubesadmin
import gi # isort:skip
gi.require_version('Gtk', '3.0') # isort:skip
from gi.repository import Gtk, Pango # isort:skip
Expand Down Expand Up @@ -44,7 +43,7 @@ def name(self):
class VMCPU(Gtk.Box):
def __init__(self):
super(DomainDecorator.VMCPU, self).__init__()

self.cpu_label = Gtk.Label(xalign=1)
self.cpu_label.set_width_chars(6)
self.pack_start(self.cpu_label, True, True, 0)
Expand All @@ -56,7 +55,7 @@ def update_state(self, cpu=0, header=False):
markup = '{:3d}%'.format(cpu)
else:
markup = ''

self.cpu_label.set_markup(markup)

class VMMem(Gtk.Box):
Expand All @@ -70,7 +69,7 @@ def update_state(self, memory=0, header=False):
markup = '<b>RAM</b>'
else:
markup = '{} MB'.format(str(int(memory/1024)))

self.mem_label.set_markup(markup)

def memory(self):
Expand Down
13 changes: 7 additions & 6 deletions qui/tray/domains.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import qui.decorators
import gi # isort:skip
gi.require_version('Gtk', '3.0') # isort:skip
from gi.repository import Gio, Gtk, Gdk # isort:skip
from gi.repository import Gio, Gtk # isort:skip

import gbulb
gbulb.install()
Expand Down Expand Up @@ -225,7 +225,7 @@ def __init__(self, vm):
# set vm := None to make this output headers.
# Header menu item reuses the domain menu item code
# so headers are aligned with the columns.

self.decorator = qui.decorators.DomainDecorator(vm)

hbox = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL)
Expand Down Expand Up @@ -288,10 +288,10 @@ def hide_spinner(self):
self.spinner.hide()

def update_state(self, state):

if self.vm is None:
return

if state in ['Running', 'Paused']:
self.hide_spinner()
else:
Expand All @@ -302,7 +302,7 @@ def update_state(self, state):
colormap[state], self.vm.name))
else:
self.name.set_label(self.vm.name)

self._set_submenu(state)

def update_stats(self, memory_kb, cpu_usage):
Expand Down Expand Up @@ -454,7 +454,8 @@ def add_domain_item(self, vm, _event, **_kwargs):
domain_item = DomainMenuItem(vm)
position = 0
for i in self.tray_menu: # pylint: disable=not-an-iterable
if not hasattr(i, 'vm') or (i.vm is not None and i.vm.name > vm.name):
if not hasattr(i, 'vm') \
or (i.vm is not None and i.vm.name > vm.name):
break
position += 1
self.tray_menu.insert(domain_item, position)
Expand Down

0 comments on commit 971d5dd

Please sign in to comment.