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

Commit

Permalink
Port org.qubes.Labels1 to new model API
Browse files Browse the repository at this point in the history
  • Loading branch information
kalkin committed Jun 27, 2017
1 parent 1480788 commit ae3eac0
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions qubesdbus/labels.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,17 @@

import qubesadmin
import qubesdbus.serialize
from qubesdbus.service import ObjectManager, PropertiesObject
from qubesdbus.service import ObjectManager
from qubesdbus.models import Label

import gi # isort:skip
gi.require_version('Gtk', '3.0') # isort:skip
from gi.repository import GLib # isort:skip pylint:disable=wrong-import-position

log = logging.getLogger('org.qubes.Labels1')
SERVICE_NAME = "org.qubes.Labels1"
SERVICE_PATH = "/org/qubes/Labels1"

log = logging.getLogger(SERVICE_NAME)
log.addHandler(JournalHandler(SYSLOG_IDENTIFIER='qubesdbus.labels'))
log.setLevel(logging.INFO)

Expand All @@ -44,11 +47,11 @@ class Labels(ObjectManager):
'''

def __init__(self, labels_data):
super(Labels, self).__init__()
super().__init__(SERVICE_NAME, SERVICE_PATH)
self.managed_objects = [self._new_label(d) for d in labels_data]

def _new_label(self, label_data):
return Label(self.bus, self.bus_name, self.bus_path, label_data)
return Label(self.bus_name, SERVICE_PATH, label_data)



Expand Down

0 comments on commit ae3eac0

Please sign in to comment.