Skip to content
This repository has been archived by the owner on Apr 26, 2020. It is now read-only.

Commit

Permalink
Make pylint happy serialize_state.py
Browse files Browse the repository at this point in the history
  • Loading branch information
kalkin committed Jun 27, 2017
1 parent ee310bf commit 48c39d6
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions qubesdbus/serialize.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,12 @@
from qubesadmin.vm import QubesVM
from qubesadmin.devices import DeviceInfo

DOMAIN_STATE_PROPERTIES = ['is_halted',
'is_paused',
'is_running',
'is_qrexec_running', ]
DOMAIN_STATE_PROPERTIES = [
'is_halted',
'is_paused',
'is_running',
'is_qrexec_running',
]


def qubes_data(app):
Expand Down Expand Up @@ -66,6 +68,7 @@ def serialize_state(state):
else:
return '=>%s<=' % state


def domain_data(vm: QubesVM) -> Dict[dbus.String, Any]:
''' Serializes a `qubes.vm.qubesvm.QubesVM` to a dictionary '''
result = dbus.Dictionary({}, signature='sv')
Expand Down Expand Up @@ -140,8 +143,10 @@ def device_collection_data(collection: DeviceCollection) -> dbus.Array:


def device_data(dev):
return {serialize_val(prop): serialize_val(getattr(dev, prop))
for prop in dir(dev) if not prop.startswith('_')}
return {
serialize_val(prop): serialize_val(getattr(dev, prop))
for prop in dir(dev) if not prop.startswith('_')
}


def label_path(label: Label) -> dbus.ObjectPath:
Expand Down

0 comments on commit 48c39d6

Please sign in to comment.