hagino3000's blog

平成アーカイブス (更新停止)

Skype4Pyのメモ

Skypeをサーバーで動かす

Skypeをデーモンとして立ち上げるためのスクリプト: http://gist.github.com/557242


via http://twitter.com/moriyoshit/status/25334383350

MacbookでSkype4Pyを動かすための準備

Pythonを32bit起動しないといけないので*1、次のコマンドを実行。MacPortsで入れたpythonを使う場合はまた別のやり方になる。

defaults write com.apple.versioner.python Prefer-32-Bit -bool yes


Skype4Py 10.0.32.0はそのままでは動かないので次のパッチを当てる。*2

--- Skype4Py.orig/api/darwin.py	2009-09-25 06:13:41.000000000 -0400
+++ Skype4Py/api/darwin.py	2010-03-20 18:19:18.000000000 -0400
@@ -297,6 +297,7 @@
         self.center = CFDistributedNotificationCenter()
         self.is_available = False
         self.client_id = -1
+        self.thread_started = False
 
     def run(self):
         self.logger.info('thread started')
@@ -363,6 +364,16 @@
         time.sleep(1.0)
         return self.is_available
 
+    def start(self):
+        """
+        Start the thread associated with this API object.
+        Ensure that the call is made no more than once,
+        to avoid raising a RuntimeError.
+        """
+        if not self.thread_started:
+            super(SkypeAPI, self).start()
+            self.thread_started = True
+
     def startup(self, minimized, nosplash):
         if not self.is_running():
             from subprocess import Popen


それでもまだ動かないので次のパッチを当てる。*3

--- Skype4Py.orig/chat.py	2009-09-18 00:15:17.000000000 +0900
+++ Skype4Py/chat.py	2010-09-20 15:09:44.000000000 +0900
@@ -338,7 +338,7 @@
     """)
 
     def _GetRecentMessages(self):
-        return ChatMessageCollection(self._Owner, split(self._Property('RECENTCHATMESSAGES', Cache=False), ', '))
+        return ChatMessageCollection(self._Owner, split(self._Property('RECENTCHATMESSAGES', Cache=False)))
 
     RecentMessages = property(_GetRecentMessages,
     doc="""Most recent chat messages.