packages: python-skype/skype.py - add support for blobs (bookmarked chats), ...

glen glen at pld-linux.org
Thu Dec 10 10:49:04 CET 2009


Author: glen                         Date: Thu Dec 10 09:49:03 2009 GMT
Module: packages                      Tag: HEAD
---- Log message:
- add support for blobs (bookmarked chats), use "/get uri" in skype window get to get blob

---- Files affected:
packages/python-skype:
   skype.py (1.1 -> 1.2) 

---- Diffs:

================================================================
Index: packages/python-skype/skype.py
diff -u packages/python-skype/skype.py:1.1 packages/python-skype/skype.py:1.2
--- packages/python-skype/skype.py:1.1	Tue Nov  3 10:25:49 2009
+++ packages/python-skype/skype.py	Thu Dec 10 10:48:58 2009
@@ -16,7 +16,7 @@
     sys.exit()
 
 # strip skype: prefix
-if CmdLine[:6] == "skype:":
+if CmdLine[:6] == 'skype:':
 	CmdLine = CmdLine[6:]
 
 # Creating Skype object and assigning event handlers..
@@ -24,23 +24,30 @@
 
 # Starting Skype if it's not running already..
 if not skype.Client.IsRunning:
-    print 'Starting Skype..'
+    print 'Starting Skype...'
     skype.Client.Start()
 
 # Attatching to Skype..
-print 'Connecting to Skype..'
+print 'Connecting to Skype...'
 skype.Attach()
 
+# Parse: skype:?chat&blob=TZGEqhqepyo5Rvvw9kj_ZbbdbHIGqQWNDfh1e8f7IS6jZXgaqpJ9zqW_nXbqyHicAJQjTJLYRvz6vkRV7_kqYr6vhQq4kgBnKA
+if CmdLine[:11] == '?chat&blob=':
+    chat_id = CmdLine[11:]
+    print 'Opening chat with blob ' + chat_id + '...'
+    chat = skype.CreateChatUsingBlob(chat_id)
+    if chat.Topic:
+        print "Chat topic: %s" % chat.Topic
+    chat.OpenWindow()
+    sys.exit();
+
 # Checking if what we got from command line parameter is present in our contact list
-Found = False
 for F in skype.Friends:
     if F.Handle == CmdLine:
-        Found = True
-        print 'Chatting ' + F.Handle + '..'
-        chat = skype.CreateChatWith(CmdLine);
+        print 'Chatting ' + F.Handle + '...'
+        chat = skype.CreateChatWith(CmdLine)
         chat.OpenWindow()
-        break
+        sys.exit()
 
-if not Found:
-    print 'Call target not found in contact list'
-    sys.exit()
+print 'Call target [%s] not found in contact list' % CmdLine
+sys.exit()
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/python-skype/skype.py?r1=1.1&r2=1.2&f=u



More information about the pld-cvs-commit mailing list