Fix compilation error using python2.7
[python-purple] / account.pyx
index 36902a7..81d6ab9 100644 (file)
 #  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
 
-cimport purple
+cimport account
+cimport accountopt
+cimport blist
+cimport plugin
+cimport prefs
+cimport prpl
+cimport savedstatuses
+cimport server
+cimport status
 
 cdef class Account:
     """
@@ -327,7 +335,7 @@ cdef class Account:
 
             sett = str(<char *> setting)
 
-            if not po.has_key(sett):
+            if sett not in po:
                 iter = iter.next
                 continue
 
@@ -614,11 +622,12 @@ cdef class Account:
     def set_active_status(self, type, msg=None):
         cdef status.PurpleStatusType *c_statustype = NULL
         cdef savedstatuses.PurpleSavedStatus *c_savedstatus = NULL
+        cdef char* msg_literal = "message"
 
         if self.__exists:
             if msg:
                 account.purple_account_set_status(self._get_structure(),
-                        <char *> type, True, "message", <char *> msg, NULL)
+                        <char *> type, True, msg_literal, <char *> msg, NULL)
             else:
                 account.purple_account_set_status(self._get_structure(),
                         <char *> type, True, NULL)
@@ -669,3 +678,5 @@ cdef class Account:
             return True
         else:
             return False
+
+include "buddy.pyx"