[Telepathy-commits] [telepathy-pinocchio/master] cut unused functions

Travis Reitter travis.reitter at collabora.co.uk
Fri Aug 15 16:12:46 PDT 2008


---
 pinocchio/connection/__init__.py |   15 -----------
 pinocchio/server/__init__.py     |   50 --------------------------------------
 2 files changed, 0 insertions(+), 65 deletions(-)

diff --git a/pinocchio/connection/__init__.py b/pinocchio/connection/__init__.py
index 0096ccc..16b9244 100644
--- a/pinocchio/connection/__init__.py
+++ b/pinocchio/connection/__init__.py
@@ -173,21 +173,6 @@ class Connection(tp.server.Connection,
 
         return ids
 
-    @dbus.service.method(tp.interfaces.CONNECTION, in_signature='s',
-                         out_signature='')
-    def set_contacts_file(self, contacts_file):
-        """Set the contact list source file for this connection. Must be called
-        before Connect() and at most once for the lifetime of the connection.
-
-        Arguments:
-        contacts_file -- absolute path to the contacts file
-        """
-        # disallow setting the file after connecting
-        if self._status != tp.constants.CONNECTION_STATUS_DISCONNECTED:
-            raise tp.errors.NotAvailable
-
-        self._contacts_file = contacts_file
-
     @dbus.service.method(tp.interfaces.CONNECTION, in_signature='',
                          out_signature='')
     def reset_to_default_contacts_file(self):
diff --git a/pinocchio/server/__init__.py b/pinocchio/server/__init__.py
index e5da1c1..1489ec3 100644
--- a/pinocchio/server/__init__.py
+++ b/pinocchio/server/__init__.py
@@ -297,56 +297,6 @@ class StoredList:
 
         return handle_contact
 
-    def to_xml(self):
-        """Returns xml.dom.minidom.Document representation of full Contact List.
-        
-        Internally, this XML is structured as:
-
-            <roster>
-                <contact>
-                    ...
-                </contact>
-                ...
-                <contact>
-                    ...
-                </contact>
-            </roster>
-        """
-        impl = minidom.getDOMImplementation()
-        xml_file = impl.createDocument(None, 'roster', None)
-        root = xml_file.documentElement
-
-        for contact in self.contacts:
-            root.appendChild(contact.to_xml().documentElement)
-
-        return xml_file
-
-    def commit(self, file_dest=None):
-        """Write contact list to XML file on disk.
-
-        Arguments:
-        file_dest -- XML file containing contact list (default:
-                     ${ACCOUNT_DIR}/contacts-modified.xml)
-
-
-        Exceptions:
-        IOError -- failed to read contact list file
-        IndexError -- contact list file parsing failed
-        """
-        if file_dest == None:
-            file_dest = self.filename
-
-        contacts_file = open(file_dest, 'w')
-
-        xml_file = self.to_xml()
-        xml_contents = xml_file.toprettyxml()
-
-        # this doesn't seem to work - not sure why; it should be simpler
-        #xml_file.writexml(contacts_file, addindent='    ', encoding='utf-8')
-        contacts_file.write(xml_contents.encode('utf-8'))
-
-        contacts_file.close()
-
 class StoredContactList(StoredList):
     def __init__(self, connection, channel_handle_obj):
         """
-- 
1.5.6.3



More information about the Telepathy-commits mailing list