From b330f73e3fcbaa183bead157af36e43d229e31e9 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Fri, 20 Sep 2013 14:21:29 +0100 Subject: [PATCH 04/10] constants: factor out PREFIX This will mean we can switch over to im.telepathy1 more easily. --- tests/twisted/constants.py | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/tests/twisted/constants.py b/tests/twisted/constants.py index 1ec2069..2b46165 100644 --- a/tests/twisted/constants.py +++ b/tests/twisted/constants.py @@ -4,7 +4,9 @@ Some handy constants for other tests to share and enjoy. from dbus import PROPERTIES_IFACE -CM = "org.freedesktop.Telepathy.ConnectionManager" +PREFIX = "org.freedesktop.Telepathy" + +CM = PREFIX + ".ConnectionManager" HT_NONE = 0 HT_CONTACT = 1 @@ -12,7 +14,7 @@ HT_ROOM = 2 HT_LIST = 3 HT_GROUP = 4 -CHANNEL = "org.freedesktop.Telepathy.Channel" +CHANNEL = PREFIX + ".Channel" CHANNEL_IFACE_CALL_STATE = CHANNEL + ".Interface.CallState" CHANNEL_IFACE_CHAT_STATE = CHANNEL + '.Interface.ChatState' @@ -46,7 +48,7 @@ CHANNEL_TYPE_SERVER_AUTHENTICATION = \ CHANNEL_TYPE_SERVER_TLS_CONNECTION = \ CHANNEL + ".Type.ServerTLSConnection" -TP_AWKWARD_PROPERTIES = "org.freedesktop.Telepathy.Properties" +TP_AWKWARD_PROPERTIES = PREFIX + ".Properties" PROPERTY_FLAG_READ = 1 PROPERTY_FLAG_WRITE = 2 PROPERTY_FLAGS_RW = PROPERTY_FLAG_READ | PROPERTY_FLAG_WRITE @@ -66,20 +68,20 @@ CALL_INITIAL_VIDEO = CHANNEL_TYPE_CALL + '.InitialVideo' CALL_INITIAL_VIDEO_NAME = CHANNEL_TYPE_CALL + '.InitialVideoName' CALL_MUTABLE_CONTENTS = CHANNEL_TYPE_CALL + '.MutableContents' -CALL_CONTENT = 'org.freedesktop.Telepathy.Call1.Content' +CALL_CONTENT = PREFIX + '.Call1.Content' CALL_CONTENT_IFACE_MEDIA = \ - 'org.freedesktop.Telepathy.Call1.Content.Interface.Media' + PREFIX + '.Call1.Content.Interface.Media' CALL_CONTENT_IFACE_DTMF = \ - 'org.freedesktop.Telepathy.Call1.Content.Interface.DTMF' + PREFIX + '.Call1.Content.Interface.DTMF' CALL_CONTENT_MEDIADESCRIPTION = \ - 'org.freedesktop.Telepathy.Call1.Content.MediaDescription' + PREFIX + '.Call1.Content.MediaDescription' -CALL_STREAM = 'org.freedesktop.Telepathy.Call1.Stream' +CALL_STREAM = PREFIX + '.Call1.Stream' CALL_STREAM_IFACE_MEDIA = \ - 'org.freedesktop.Telepathy.Call1.Stream.Interface.Media' + PREFIX + '.Call1.Stream.Interface.Media' -CALL_STREAM_ENDPOINT = 'org.freedesktop.Telepathy.Call1.Stream.Endpoint' +CALL_STREAM_ENDPOINT = PREFIX + '.Call1.Stream.Endpoint' CALL_MEDIA_TYPE_AUDIO = 0 CALL_MEDIA_TYPE_VIDEO = 1 @@ -166,7 +168,7 @@ CONTACT_LIST_STATE_WAITING = 1 CONTACT_LIST_STATE_FAILURE = 2 CONTACT_LIST_STATE_SUCCESS = 3 -CONN = "org.freedesktop.Telepathy.Connection" +CONN = PREFIX + ".Connection" CONN_IFACE_AVATARS = CONN + '.Interface.Avatars' CONN_IFACE_ALIASING = CONN + '.Interface.Aliasing' CONN_IFACE_CAPS = CONN + '.Interface.Capabilities' @@ -189,9 +191,9 @@ CONN_IFACE_ADDRESSING = CONN + '.Interface.Addressing1' ATTR_CONTACT_CAPABILITIES = CONN_IFACE_CONTACT_CAPS + '/capabilities' ATTR_PRESENCE = CONN_IFACE_SIMPLE_PRESENCE + '/presence' -STREAM_HANDLER = 'org.freedesktop.Telepathy.Media.StreamHandler' +STREAM_HANDLER = PREFIX + '.Media.StreamHandler' -ERROR = 'org.freedesktop.Telepathy.Error' +ERROR = PREFIX + '.Error' INVALID_ARGUMENT = ERROR + '.InvalidArgument' NOT_IMPLEMENTED = ERROR + '.NotImplemented' NOT_AVAILABLE = ERROR + '.NotAvailable' @@ -400,7 +402,7 @@ MEDIA_CAP_GTALKP2P = 8 MEDIA_CAP_ICEUDP = 16 MEDIA_CAP_IMMUTABLE_STREAMS = 32 -CLIENT = 'org.freedesktop.Telepathy.Client' +CLIENT = PREFIX + '.Client' PRESENCE_OFFLINE = 1 PRESENCE_AVAILABLE = 2 @@ -470,7 +472,7 @@ class SendError(object): TOO_LONG = 4 NOT_IMPLEMENTED = 5 -PROTOCOL = 'org.freedesktop.Telepathy.Protocol' +PROTOCOL = PREFIX + '.Protocol' PROTOCOL_IFACE_PRESENCES = PROTOCOL + '.Interface.Presence' PROTOCOL_IFACE_ADDRESSING = PROTOCOL + '.Interface.Addressing' PROTOCOL_IFACE_AVATARS = PROTOCOL + '.Interface.Avatars' @@ -481,7 +483,7 @@ PARAM_HAS_DEFAULT = 4 PARAM_SECRET = 8 PARAM_DBUS_PROPERTY = 16 -AUTHENTICATION = 'org.freedesktop.Telepathy.Authentication' +AUTHENTICATION = PREFIX + '.Authentication' AUTH_TLS_CERT = AUTHENTICATION + ".TLSCertificate" TLS_CERT_STATE_PENDING = 0 -- 1.8.4.rc3