[kupfer: 18/23] plugin: thunderbird: remove comments



commit cbeaaf40521388a5eba86ec679c5d8a48a077d91
Author: Karol BÄ?dkowski <karol bedkowsk+gh gmail com>
Date:   Mon Dec 14 22:20:44 2009 +0100

    plugin: thunderbird: remove comments
    
    I agree with changes described by comments - I remove it.
    As get_addressbook_dir_file provide only dir I renamed it to
    get_addressbook_dir.
    
    Parser correct handles UTF â?? non-ascii characters are spited
    to bytes and saved as $<hex number>. Internally Thundebird store a
    ll in UTF-8, so after unescape we have string in utf
    (_unescape_data method, for example "Å?" character is stored as $C5$82).

 kupfer/plugin/thunderbird.py         |   12 +-----------
 kupfer/plugin/thunderbird_support.py |    4 ++--
 2 files changed, 3 insertions(+), 13 deletions(-)
---
diff --git a/kupfer/plugin/thunderbird.py b/kupfer/plugin/thunderbird.py
index 13193a0..64354a2 100644
--- a/kupfer/plugin/thunderbird.py
+++ b/kupfer/plugin/thunderbird.py
@@ -34,8 +34,6 @@ def _check_email(email):
 
 class Contact(Leaf):
 	''' Leaf represents a single contact from the address book '''
-	# no builtin actions if it is later going to be "decorated" automatically with NewMailAction
-	# that's why it was duplicated
 	def get_description(self):
 		return self.object
 
@@ -103,15 +101,7 @@ class ContactsSource(AppLeafContentMixin, Source, FilesystemWatchMixin, Pickling
 		self.unpickle_finish()
 
 	def unpickle_finish(self):
-		# _abook_dir might be None here => then we crash
-		# File "/usr/lib/python2.5/posixpath.py", line 195, in isdir
-		#	st = os.stat(path)
-		# TypeError: coercing to Unicode: need string or buffer, NoneType found
-
-		# don't store _abook_dir or _abook_file on self,
-		# they are never needed later Simply compute them here
-		# I changed the function to return only the directory
-		abook_dir = support.get_addressbook_dir_file()
+		abook_dir = support.get_addressbook_dir()
 		if not abook_dir or not os.path.isdir(abook_dir):
 			return
 		self.monitor_token = self.monitor_directories(abook_dir)
diff --git a/kupfer/plugin/thunderbird_support.py b/kupfer/plugin/thunderbird_support.py
index ebb0f9b..4ff1e21 100644
--- a/kupfer/plugin/thunderbird_support.py
+++ b/kupfer/plugin/thunderbird_support.py
@@ -232,7 +232,7 @@ def _mork2contacts(tables):
 					yield (display_name, email)
 
 
-def get_addressbook_dir_file():
+def get_addressbook_dir():
 	''' Get path to addressbook file from default profile. '''
 	thunderbird_home, thunderbird_profile = None, None
 	for thome, tprofile in THUNDERBIRD_PROFILES:
@@ -265,7 +265,7 @@ def get_addressbook_dir_file():
 def get_addressbook_file():
 	''' Get full path to the Thunderbird address book file.
 		Return None if it don't exists '''
-	path = get_addressbook_dir_file()
+	path = get_addressbook_dir()
 	if not path:
 		return None
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]