Fix compilation error using python2.7
[python-purple] / nullclient.py
index 0438951..8386d7c 100644 (file)
 #  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
 
-import ecore
 import getpass
+import sys, dl
+import time
+
+sys.setdlopenflags(dl.RTLD_NOW | dl.RTLD_GLOBAL)
+
 import purple
-import sys
 
 # The information below is needed by libpurple
 __NAME__ = "nullclient"
@@ -60,5 +63,10 @@ if __name__ == '__main__':
     # Enable account (connects automatically)
     account.set_enabled(True)
 
-    # Initializes ecore mainloop
-    ecore.main_loop_begin()
+    while True:
+        try:
+            core.iterate_main_loop()
+            time.sleep(0.01)
+        except KeyboardInterrupt:
+            core.destroy()
+            break