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

Commit

Permalink
Fix some mypy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
kalkin committed Oct 3, 2016
1 parent cda2e8c commit 6bad7a0
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion qubesdbus/proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class QubesDbusProxy(Extension):
def __init__(self):
super(QubesDbusProxy, self).__init__()
self.domains = {} # type: Dict[int, bool]
self.new_vm = []
self.new_vm = [] # type: List[QubesVM]

@handler('*')
def forward_vm_event(self, vm, event, *args, **kwargs):
Expand Down
4 changes: 2 additions & 2 deletions qubesdbus/serialize.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def label_data(lab):
value = getattr(lab, name)
result[name] = dbus.String(value)
except AttributeError:
result[name] = ''
result[name] = dbus.String('')
return result


Expand All @@ -109,7 +109,7 @@ def serialize_val(value):


def label_path(label):
# type: (qubes.Label) -> dbus.ObjectPath
# type: (Label) -> dbus.ObjectPath
''' Return the D-Bus object path for a `qubes.Label` '''
return dbus.ObjectPath('/org/qubes/Labels1/labels/' + label.name)

Expand Down
2 changes: 2 additions & 0 deletions stubs/dbus/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,10 @@ def SessionBus() -> dbus._dbus.SessionBus: ...

class String(str): ...
class Boolean(int): ...
class Int32(int): ...

class Array(list): ...
class Dictionary(dict): ...
class ObjectPath(str): ...
# vim: syntax=python

1 change: 1 addition & 0 deletions stubs/libvirt/__init__.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
class libvirtError(Exception): ...
4 changes: 4 additions & 0 deletions stubs/qubes/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,7 @@ from typing import (List)
import qubes.vm
class Qubes(object):
domains = ... # type: List[qubes.vm.BaseVM]
labels = ... # type: Dict[str,qubes.Label]

class Label(object):
name = ... # type: str

0 comments on commit 6bad7a0

Please sign in to comment.