From 5a13e91a53ca983663f720fe2eff4801da21646a Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Thu, 26 Sep 2013 19:17:58 +0100 Subject: [PATCH 4/5] constants, servicetest: update to Telepathy 1 This is not as trivial as it might seem. Some (but not all!) interfaces have gained versioning (a trailing "1" in practice), some enums have been renumbered, and some things have been deleted. I'm reasonably sure this version is correct: I've tested it in Haze, Idle and Salut. --- tests/twisted/constants.py | 144 +++++++++++++++---------------------------- tests/twisted/servicetest.py | 14 +++-- 2 files changed, 59 insertions(+), 99 deletions(-) diff --git a/tests/twisted/constants.py b/tests/twisted/constants.py index 6bb50c7..e72c592 100644 --- a/tests/twisted/constants.py +++ b/tests/twisted/constants.py @@ -22,7 +22,7 @@ Some handy constants for other tests to share and enjoy. from dbus import PROPERTIES_IFACE, INTROSPECTABLE_IFACE -PREFIX = "org.freedesktop.Telepathy" +PREFIX = "im.telepathy1" PATH_PREFIX = '/' + PREFIX.replace('.', '/') tp_name_prefix = PREFIX @@ -38,42 +38,31 @@ HT_GROUP = 4 CHANNEL = PREFIX + ".Channel" -CHANNEL_IFACE_CALL_STATE = CHANNEL + ".Interface.CallState" -CHANNEL_IFACE_CHAT_STATE = CHANNEL + '.Interface.ChatState' -CHANNEL_IFACE_DESTROYABLE = CHANNEL + ".Interface.Destroyable" -CHANNEL_IFACE_DTMF = CHANNEL + ".Interface.DTMF" -CHANNEL_IFACE_GROUP = CHANNEL + ".Interface.Group" -CHANNEL_IFACE_HOLD = CHANNEL + ".Interface.Hold" -CHANNEL_IFACE_MEDIA_SIGNALLING = CHANNEL + ".Interface.MediaSignalling" -CHANNEL_IFACE_MESSAGES = CHANNEL + ".Interface.Messages" -CHANNEL_IFACE_PASSWORD = CHANNEL + ".Interface.Password" -CHANNEL_IFACE_TUBE = CHANNEL + ".Interface.Tube" -CHANNEL_IFACE_SASL_AUTH = CHANNEL + ".Interface.SASLAuthentication" -CHANNEL_IFACE_CONFERENCE = CHANNEL + '.Interface.Conference' -CHANNEL_IFACE_ROOM = CHANNEL + '.Interface.Room2' +CHANNEL_IFACE_CHAT_STATE = CHANNEL + '.Interface.ChatState1' +CHANNEL_IFACE_DESTROYABLE = CHANNEL + ".Interface.Destroyable1" +CHANNEL_IFACE_DTMF = CHANNEL + ".Interface.DTMF1" +CHANNEL_IFACE_GROUP = CHANNEL + ".Interface.Group1" +CHANNEL_IFACE_HOLD = CHANNEL + ".Interface.Hold1" +CHANNEL_IFACE_PASSWORD = CHANNEL + ".Interface.Password1" +CHANNEL_IFACE_TUBE = CHANNEL + ".Interface.Tube1" +CHANNEL_IFACE_SASL_AUTH = CHANNEL + ".Interface.SASLAuthentication1" +CHANNEL_IFACE_CONFERENCE = CHANNEL + '.Interface.Conference1' +CHANNEL_IFACE_ROOM = CHANNEL + '.Interface.Room1' CHANNEL_IFACE_ROOM_CONFIG = CHANNEL + '.Interface.RoomConfig1' -CHANNEL_IFACE_SUBJECT = CHANNEL + '.Interface.Subject2' -CHANNEL_IFACE_FILE_TRANSFER_METADATA = CHANNEL + '.Interface.FileTransfer.Metadata' +CHANNEL_IFACE_SUBJECT = CHANNEL + '.Interface.Subject1' +CHANNEL_IFACE_FILE_TRANSFER_METADATA = CHANNEL + '.Interface.FileTransfer.Metadata1' CHANNEL_TYPE_CALL = CHANNEL + ".Type.Call1" -CHANNEL_TYPE_CONTACT_LIST = CHANNEL + ".Type.ContactList" -CHANNEL_TYPE_CONTACT_SEARCH = CHANNEL + ".Type.ContactSearch" +CHANNEL_TYPE_CONTACT_SEARCH = CHANNEL + ".Type.ContactSearch1" CHANNEL_TYPE_TEXT = CHANNEL + ".Type.Text" -CHANNEL_TYPE_TUBES = CHANNEL + ".Type.Tubes" -CHANNEL_TYPE_STREAM_TUBE = CHANNEL + ".Type.StreamTube" -CHANNEL_TYPE_DBUS_TUBE = CHANNEL + ".Type.DBusTube" -CHANNEL_TYPE_TEXT = CHANNEL + ".Type.Text" -CHANNEL_TYPE_FILE_TRANSFER = CHANNEL + ".Type.FileTransfer" -CHANNEL_TYPE_ROOM_LIST = CHANNEL + ".Type.RoomList" +CHANNEL_TYPE_STREAM_TUBE = CHANNEL + ".Type.StreamTube1" +CHANNEL_TYPE_DBUS_TUBE = CHANNEL + ".Type.DBusTube1" +CHANNEL_TYPE_FILE_TRANSFER = CHANNEL + ".Type.FileTransfer1" +CHANNEL_TYPE_ROOM_LIST = CHANNEL + ".Type.RoomList1" CHANNEL_TYPE_SERVER_AUTHENTICATION = \ - CHANNEL + ".Type.ServerAuthentication" + CHANNEL + ".Type.ServerAuthentication1" CHANNEL_TYPE_SERVER_TLS_CONNECTION = \ - CHANNEL + ".Type.ServerTLSConnection" - -TP_AWKWARD_PROPERTIES = PREFIX + ".Properties" -PROPERTY_FLAG_READ = 1 -PROPERTY_FLAG_WRITE = 2 -PROPERTY_FLAGS_RW = PROPERTY_FLAG_READ | PROPERTY_FLAG_WRITE + CHANNEL + ".Type.ServerTLSConnection1" CHANNEL_TYPE = CHANNEL + '.ChannelType' TARGET_HANDLE_TYPE = CHANNEL + '.TargetHandleType' @@ -92,7 +81,7 @@ CALL_MUTABLE_CONTENTS = CHANNEL_TYPE_CALL + '.MutableContents' CALL_CONTENT = PREFIX + '.Call1.Content' CALL_CONTENT_IFACE_MEDIA = CALL_CONTENT + '.Interface.Media' -CALL_CONTENT_IFACE_DTMF = CALL_CONTENT + '.Interface.DTMF' +CALL_CONTENT_IFACE_DTMF = CALL_CONTENT + '.Interface.DTMF1' CALL_CONTENT_MEDIADESCRIPTION = CALL_CONTENT + '.MediaDescription' @@ -187,29 +176,27 @@ CONTACT_LIST_STATE_FAILURE = 2 CONTACT_LIST_STATE_SUCCESS = 3 CONN = PREFIX + ".Connection" -CONN_IFACE_AVATARS = CONN + '.Interface.Avatars' -CONN_IFACE_ALIASING = CONN + '.Interface.Aliasing' -CONN_IFACE_CAPS = CONN + '.Interface.Capabilities' +CONN_IFACE_AVATARS = CONN + '.Interface.Avatars1' +CONN_IFACE_ALIASING = CONN + '.Interface.Aliasing1' CONN_IFACE_CONTACTS = CONN + '.Interface.Contacts' -CONN_IFACE_CONTACT_CAPS = CONN + '.Interface.ContactCapabilities' -CONN_IFACE_CONTACT_INFO = CONN + ".Interface.ContactInfo" -CONN_IFACE_PRESENCE = CONN + '.Interface.Presence' -CONN_IFACE_SIMPLE_PRESENCE = CONN + '.Interface.SimplePresence' +CONN_IFACE_CONTACT_CAPS = CONN + '.Interface.ContactCapabilities1' +CONN_IFACE_CONTACT_INFO = CONN + ".Interface.ContactInfo1" +CONN_IFACE_PRESENCE = CONN + '.Interface.Presence1' CONN_IFACE_REQUESTS = CONN + '.Interface.Requests' -CONN_IFACE_LOCATION = CONN + '.Interface.Location' +CONN_IFACE_LOCATION = CONN + '.Interface.Location1' CONN_IFACE_GABBLE_DECLOAK = CONN + '.Interface.Gabble.Decloak' -CONN_IFACE_MAIL_NOTIFICATION = CONN + '.Interface.MailNotification' -CONN_IFACE_CONTACT_LIST = CONN + '.Interface.ContactList' -CONN_IFACE_CONTACT_GROUPS = CONN + '.Interface.ContactGroups' -CONN_IFACE_CLIENT_TYPES = CONN + '.Interface.ClientTypes' -CONN_IFACE_POWER_SAVING = CONN + '.Interface.PowerSaving' -CONN_IFACE_CONTACT_BLOCKING = CONN + '.Interface.ContactBlocking' +CONN_IFACE_MAIL_NOTIFICATION = CONN + '.Interface.MailNotification1' +CONN_IFACE_CONTACT_LIST = CONN + '.Interface.ContactList1' +CONN_IFACE_CONTACT_GROUPS = CONN + '.Interface.ContactGroups1' +CONN_IFACE_CLIENT_TYPES = CONN + '.Interface.ClientTypes1' +CONN_IFACE_POWER_SAVING = CONN + '.Interface.PowerSaving1' +CONN_IFACE_CONTACT_BLOCKING = CONN + '.Interface.ContactBlocking1' CONN_IFACE_ADDRESSING = CONN + '.Interface.Addressing1' -CONN_IFACE_SERVICE_POINT = CONN + '.Interface.ServicePoint' +CONN_IFACE_SERVICE_POINT = CONN + '.Interface.ServicePoint1' ATTR_CONTACT_ID = CONN + '/contact-id' ATTR_CONTACT_CAPABILITIES = CONN_IFACE_CONTACT_CAPS + '/capabilities' -ATTR_PRESENCE = CONN_IFACE_SIMPLE_PRESENCE + '/presence' +ATTR_PRESENCE = CONN_IFACE_PRESENCE + '/presence' ATTR_SUBSCRIBE = CONN_IFACE_CONTACT_LIST + '/subscribe' ATTR_PUBLISH = CONN_IFACE_CONTACT_LIST + '/publish' ATTR_GROUPS = CONN_IFACE_CONTACT_GROUPS + '/groups' @@ -290,17 +277,13 @@ SOCKET_ADDRESS_TYPE_IPV6 = 3 SOCKET_ACCESS_CONTROL_LOCALHOST = 0 SOCKET_ACCESS_CONTROL_PORT = 1 -SOCKET_ACCESS_CONTROL_NETMASK = 2 -SOCKET_ACCESS_CONTROL_CREDENTIALS = 3 +SOCKET_ACCESS_CONTROL_CREDENTIALS = 2 TUBE_STATE_LOCAL_PENDING = 0 TUBE_STATE_REMOTE_PENDING = 1 TUBE_STATE_OPEN = 2 TUBE_STATE_NOT_OFFERED = 3 -TUBE_TYPE_DBUS = 0 -TUBE_TYPE_STREAM = 1 - MEDIA_STREAM_DIRECTION_NONE = 0 MEDIA_STREAM_DIRECTION_SEND = 1 MEDIA_STREAM_DIRECTION_RECEIVE = 2 @@ -312,15 +295,6 @@ MEDIA_STREAM_PENDING_REMOTE_SEND = 2 MEDIA_STREAM_TYPE_AUDIO = 0 MEDIA_STREAM_TYPE_VIDEO = 1 -MEDIA_STREAM_STATE_DISCONNECTED = 0 -MEDIA_STREAM_STATE_CONNECTING = 1 -MEDIA_STREAM_STATE_CONNECTED = 2 - -MEDIA_STREAM_DIRECTION_NONE = 0 -MEDIA_STREAM_DIRECTION_SEND = 1 -MEDIA_STREAM_DIRECTION_RECEIVE = 2 -MEDIA_STREAM_DIRECTION_BIDIRECTIONAL = 3 - FT_STATE_NONE = 0 FT_STATE_PENDING = 1 FT_STATE_ACCEPTED = 2 @@ -367,8 +341,7 @@ GF_MESSAGE_RESCIND = 128 GF_CHANNEL_SPECIFIC_HANDLES = 256 GF_ONLY_ONE_GROUP = 512 GF_HANDLE_OWNERS_NOT_AVAILABLE = 1024 -GF_PROPERTIES = 2048 -GF_MEMBERS_CHANGED_DETAILED = 4096 +GF_MESSAGE_DEPART = 2048 GC_REASON_NONE = 0 GC_REASON_OFFLINE = 1 @@ -485,12 +458,6 @@ MT_NOTICE = 2 MT_AUTO_REPLY = 3 MT_DELIVERY_REPORT = 4 -class MessageFlag(object): - TRUNCATED = 1 - NON_TEXT_CONTENT = 2 - SCROLLBACK = 4 - RESCUED = 8 - class SendError(object): UNKNOWN = 0 OFFLINE = 1 @@ -500,9 +467,9 @@ class SendError(object): NOT_IMPLEMENTED = 5 PROTOCOL = PREFIX + '.Protocol' -PROTOCOL_IFACE_PRESENCES = PROTOCOL + '.Interface.Presence' -PROTOCOL_IFACE_ADDRESSING = PROTOCOL + '.Interface.Addressing' -PROTOCOL_IFACE_AVATARS = PROTOCOL + '.Interface.Avatars' +PROTOCOL_IFACE_PRESENCES = PROTOCOL + '.Interface.Presence1' +PROTOCOL_IFACE_ADDRESSING = PROTOCOL + '.Interface.Addressing1' +PROTOCOL_IFACE_AVATARS = PROTOCOL + '.Interface.Avatars1' PARAM_REQUIRED = 1 PARAM_REGISTER = 2 @@ -522,9 +489,9 @@ TLS_REJECT_REASON_UNTRUSTED = 1 # Channel.Interface.Messages -MESSAGE_PART_SUPPORT_FLAGS = CHANNEL_IFACE_MESSAGES + '.MessagePartSupportFlags' -DELIVERY_REPORTING_SUPPORT = CHANNEL_IFACE_MESSAGES + '.DeliveryReportingSupport' -SUPPORTED_CONTENT_TYPES = CHANNEL_IFACE_MESSAGES + '.SupportedContentTypes' +MESSAGE_PART_SUPPORT_FLAGS = CHANNEL_TYPE_TEXT + '.MessagePartSupportFlags' +DELIVERY_REPORTING_SUPPORT = CHANNEL_TYPE_TEXT + '.DeliveryReportingSupport' +SUPPORTED_CONTENT_TYPES = CHANNEL_TYPE_TEXT + '.SupportedContentTypes' MSG_SENDING_FLAGS_REPORT_DELIVERY = 1 MSG_SENDING_FLAGS_REPORT_READ = 2 @@ -543,15 +510,7 @@ DELIVERY_STATUS_ACCEPTED = 4 DELIVERY_STATUS_READ = 5 DELIVERY_STATUS_DELETED = 6 -MEDIA_STREAM_ERROR_UNKNOWN = 0 -MEDIA_STREAM_ERROR_EOS = 1 -MEDIA_STREAM_ERROR_CODEC_NEGOTIATION_FAILED = 2 -MEDIA_STREAM_ERROR_CONNECTION_FAILED = 3 -MEDIA_STREAM_ERROR_NETWORK_ERROR = 4 -MEDIA_STREAM_ERROR_NO_CODECS = 5 -MEDIA_STREAM_ERROR_INVALID_CM_BEHAVIOR = 6 -MEDIA_STREAM_ERROR_MEDIA_ERROR = 7 - +PASSWORD_FLAG_HINT = 4 PASSWORD_FLAG_PROVIDE = 8 # Channel.Interface.Room @@ -578,26 +537,25 @@ HANDLER = PREFIX + '.Client.Handler' CLIENT_IFACE_REQUESTS = CLIENT + '.Interface.Requests' ACCOUNT = PREFIX + '.Account' -ACCOUNT_IFACE_AVATAR = ACCOUNT + '.Interface.Avatar' -ACCOUNT_IFACE_ADDRESSING = ACCOUNT + '.Interface.Addressing' -ACCOUNT_IFACE_HIDDEN = ACCOUNT + '.Interface.Hidden.DRAFT1' +ACCOUNT_IFACE_AVATAR = ACCOUNT + '.Interface.Avatar1' +ACCOUNT_IFACE_ADDRESSING = ACCOUNT + '.Interface.Addressing1' +ACCOUNT_IFACE_HIDDEN = ACCOUNT + '.Interface.Hidden1' ACCOUNT_IFACE_NOKIA_CONDITIONS = 'com.nokia.Account.Interface.Conditions' ACCOUNT_PATH_PREFIX = PATH_PREFIX + '/Account/' AM = PREFIX + '.AccountManager' -AM_IFACE_HIDDEN = AM + '.Interface.Hidden.DRAFT1' +AM_IFACE_HIDDEN = AM + '.Interface.Hidden1' AM_PATH = PATH_PREFIX + '/AccountManager' CR = PREFIX + '.ChannelRequest' CDO = PREFIX + '.ChannelDispatchOperation' CD = PREFIX + '.ChannelDispatcher' -CD_IFACE_OP_LIST = PREFIX + '.ChannelDispatcher.Interface.OperationList' +CD_IFACE_OP_LIST = PREFIX + '.ChannelDispatcher.Interface.OperationList1' CD_PATH = PATH_PREFIX + '/ChannelDispatcher' -CD_REDISPATCH = CD + '.Interface.Redispatch.DRAFT' -MC = PREFIX + '.MissionControl5' -MC_PATH = PATH_PREFIX + '/MissionControl5' +MC = PREFIX + '.MissionControl6' +MC_PATH = PATH_PREFIX + '/MissionControl6' TESTDOT = PREFIX + ".Test." TESTSLASH = PATH_PREFIX + "/Test/" diff --git a/tests/twisted/servicetest.py b/tests/twisted/servicetest.py index c464d8f..8a813f5 100644 --- a/tests/twisted/servicetest.py +++ b/tests/twisted/servicetest.py @@ -604,7 +604,7 @@ class ConnWrapper(ProxyWrapper): return self.inspect_contacts_sync([handle])[0] def inspect_contacts_sync(self, handles): - h2asv = self.Contacts.GetContactAttributes(handles, [], True) + h2asv = self.Contacts.GetContactAttributes(handles, []) ret = [] for h in handles: ret.append(h2asv[h][cs.ATTR_CONTACT_ID]) @@ -618,14 +618,16 @@ class ConnWrapper(ProxyWrapper): def wrap_connection(conn): return ConnWrapper(conn, tp_name_prefix + '.Connection', - dict([ - (name, tp_name_prefix + '.Connection.Interface.' + name) - for name in ['Aliasing', 'Avatars', 'Capabilities', 'Contacts', - 'SimplePresence', 'Requests']] + + dict( [('Peer', 'org.freedesktop.DBus.Peer'), + ('Aliasing', cs.CONN_IFACE_ALIASING), + ('Avatars', cs.CONN_IFACE_AVATARS), + ('Contacts', cs.CONN_IFACE_CONTACTS), ('ContactCapabilities', cs.CONN_IFACE_CONTACT_CAPS), ('ContactInfo', cs.CONN_IFACE_CONTACT_INFO), ('Location', cs.CONN_IFACE_LOCATION), + ('Presence', cs.CONN_IFACE_PRESENCE), + ('Requests', cs.CONN_IFACE_REQUESTS), ('Future', tp_name_prefix + '.Connection.FUTURE'), ('MailNotification', cs.CONN_IFACE_MAIL_NOTIFICATION), ('ContactList', cs.CONN_IFACE_CONTACT_LIST), @@ -637,7 +639,7 @@ def wrap_connection(conn): def wrap_channel(chan, type_, extra=None): interfaces = { type_: tp_name_prefix + '.Channel.Type.' + type_, - 'Group': tp_name_prefix + '.Channel.Interface.Group', + 'Group': cs.CHANNEL_IFACE_GROUP, } if extra: -- 1.8.4.rc3