This repository has been archived by the owner on Apr 26, 2020. It is now read-only.
forked from kalkin/qubes-dbus
-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move Domain & Label to package qubesdbus.models
- Loading branch information
Showing
4 changed files
with
21 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ | |
# The Qubes OS Project, https://www.qubes-os.org/ | ||
# | ||
# Copyright (C) 2016 Bahtiar `kalkin-` Gadimov <[email protected]> | ||
# | ||
# This program is free software; you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation; either version 2 of the License, or | ||
|
@@ -17,7 +18,12 @@ | |
# You should have received a copy of the GNU General Public License along | ||
# with this program; if not, write to the Free Software Foundation, Inc., | ||
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | ||
''' D-Bus Domain object ''' | ||
''' Contains models for D-Bus instances we provide. | ||
Contains the folowing interface implementations: | ||
* *org.qubes.Domain* | ||
* *org.qubes.Label* | ||
''' | ||
|
||
from typing import Any, Dict, Union | ||
|
||
|
@@ -117,3 +123,14 @@ def valid_state_change(cur_state: DBusString, state: DBusString) -> bool: | |
return True | ||
|
||
return False | ||
|
||
class Label(qubesdbus.service.PropertiesObject): | ||
''' Represents a qubes label. Its D-Bus object path is | ||
`org/qubes/Labels1/labels/COLORNAME` | ||
''' | ||
|
||
def __init__(self, bus, bus_name, bus_path, data): | ||
bus_path = '/'.join([bus_path, 'labels', data['name']]) | ||
name = data['name'] | ||
super(Label, self).__init__(name, 'org.qubes.Label1', data, bus=bus, | ||
bus_name=bus_name, bus_path=bus_path) |