[Telepathy-commits] [telepathy-pinocchio/master] use a better name for get_contacts_file
Travis Reitter
travis.reitter at collabora.co.uk
Fri Aug 15 16:08:00 PDT 2008
---
pinocchio/common.py | 2 +-
pinocchio/connection/__init__.py | 10 +++++-----
tests/test-list.py | 2 +-
3 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/pinocchio/common.py b/pinocchio/common.py
index f78536f..fe10bc8 100644
--- a/pinocchio/common.py
+++ b/pinocchio/common.py
@@ -58,7 +58,7 @@ def get_account_dir(prefix, account_id):
return dir_result
-def get_contacts_file_abs(account_id, prefix=PREFIX_SAVED_PREFERRED):
+def get_contacts_file(account_id, prefix=PREFIX_SAVED_PREFERRED):
"""Returns the absolute path for the contacts file (prepending the account's
base data dir as necessary). Modified rosters are saved to disk as a
different name, so this function prefers them over the default file name.
diff --git a/pinocchio/connection/__init__.py b/pinocchio/connection/__init__.py
index 0ae88cf..0096ccc 100644
--- a/pinocchio/connection/__init__.py
+++ b/pinocchio/connection/__init__.py
@@ -61,7 +61,7 @@ class Connection(tp.server.Connection,
self.set_self_handle(self_handle)
self._manager = manager
- self._contacts_file = pin.common.get_contacts_file_abs(
+ self._contacts_file = pin.common.get_contacts_file(
account_id,
pin.common.PREFIX_SAVED_PREFERRED)
@@ -203,8 +203,8 @@ class Connection(tp.server.Connection,
# clear out any modified version of the contact list (upon next
# Connect(), the default contact list will be read in)
account_id = self.get_account_id()
- filename = pin.common.get_contacts_file_abs(account_id,
- pin.common.PREFIX_SAVED)
+ filename = pin.common.get_contacts_file(account_id,
+ pin.common.PREFIX_SAVED)
if os.path.isfile(filename):
os.remove(filename)
@@ -363,8 +363,8 @@ class Connection(tp.server.Connection,
roster_xml.appendChild(newline_value)
account_id = self.get_account_id()
- filename = pin.common.get_contacts_file_abs(account_id,
- pin.common.PREFIX_SAVED)
+ filename = pin.common.get_contacts_file(account_id,
+ pin.common.PREFIX_SAVED)
# make sure the parent directories exist
parent_dir = os.path.dirname(filename)
diff --git a/tests/test-list.py b/tests/test-list.py
index 25a6dcf..71189fe 100755
--- a/tests/test-list.py
+++ b/tests/test-list.py
@@ -192,7 +192,7 @@ if __name__ == '__main__':
# TODO: factor this out as an arg
ACCOUNT_NAME = 'default at default'
account_id = tp.server.conn._escape_as_identifier(ACCOUNT_NAME)
- contacts_filename = pin.common.get_contacts_file_abs(account_id=account_id)
+ contacts_filename = pin.common.get_contacts_file(account_id=account_id)
contacts_xml = contacts_file_get_contacts(contacts_filename)
# create a dict of contact objects to compare to the output of pinocchio-ctl
--
1.5.6.3
More information about the Telepathy-commits
mailing list