summaryrefslogtreecommitdiff
path: root/sunshine
diff options
context:
space:
mode:
authorKrzysztof Klinikowski <kkszysiu@gmail.com>2010-10-05 20:24:58 +0200
committerKrzysztof Klinikowski <kkszysiu@gmail.com>2010-10-05 20:24:58 +0200
commitb9830c29eeec1bde2aac4af6ad3e4c1ca55ab7a5 (patch)
treea573ee84f599bc75cf7d95fd8044f830f08ddfd9 /sunshine
parente80cab865fb730eeeadfbd23f3b469f4d542f2cd (diff)
Some fixed and improved logger.
Diffstat (limited to 'sunshine')
-rw-r--r--sunshine/connection.py5
-rw-r--r--sunshine/contacts_info.py2
-rw-r--r--sunshine/handle.py2
3 files changed, 6 insertions, 3 deletions
diff --git a/sunshine/connection.py b/sunshine/connection.py
index 7ac119f..40175ee 100644
--- a/sunshine/connection.py
+++ b/sunshine/connection.py
@@ -57,6 +57,8 @@ from sunshine.util.decorator import async, stripHTML, unescape
__all__ = ['GaduClientFactory', 'SunshineConnection']
logger = logging.getLogger('Sunshine.Connection')
+observer = log.PythonLoggingObserver(loggerName='Sunshine.Connection')
+observer.start()
#SSL
ssl_support = False
@@ -450,8 +452,9 @@ class SunshineConnection(telepathy.server.Connection,
telepathy.CONNECTION_STATUS_REASON_AUTHENTICATION_FAILED)
reactor.stop()
- @async
+ #@async
def on_updateContact(self, contact):
+ #handle = SunshineHandleFactory(self, 'contact', str(contact.uin))
handle_id = self.get_handle_id_by_name(telepathy.constants.HANDLE_TYPE_CONTACT, str(contact.uin))
handle = self.handle(telepathy.constants.HANDLE_TYPE_CONTACT, handle_id)
logger.info("Status changed for UIN: %s, id: %s, status: %s, description: '%s'" % (contact.uin, handle.id, contact.status, contact.get_desc()))
diff --git a/sunshine/contacts_info.py b/sunshine/contacts_info.py
index d7e0060..68a65f4 100644
--- a/sunshine/contacts_info.py
+++ b/sunshine/contacts_info.py
@@ -26,7 +26,7 @@ import telepathy
import telepathy.constants
import telepathy.errors
-from twisted.internet.defer import Deferred
+from twisted.internet import defer
from sunshine.handle import SunshineHandleFactory
from sunshine.util.decorator import async
diff --git a/sunshine/handle.py b/sunshine/handle.py
index d26d442..23b994a 100644
--- a/sunshine/handle.py
+++ b/sunshine/handle.py
@@ -95,7 +95,7 @@ class SunshineSelfHandle(SunshineHandle):
class SunshineContactHandle(SunshineHandle):
#TODO: GG using just UIN to indenrify user so we need just contact_uin instead of contact_account and contact_network)
- def __init__(self, connection, id, contact_account, contact_network):
+ def __init__(self, connection, id, contact_account, contact_network=None):
handle_type = telepathy.HANDLE_TYPE_CONTACT
handle_name = str(contact_account)
self.account = str(contact_account)