Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mrDoctorWho/vk4xmpp.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Smith <mrdoctorwho@gmail.com>2017-05-07 07:58:54 +0300
committerJohn Smith <mrdoctorwho@gmail.com>2017-05-07 07:58:54 +0300
commit176ba55749cec6d39a2a854740a7a744b3270a46 (patch)
tree5f319d0c23dc1c81045ede8808c35d4b41174dfd
parent4753bc59705532d76c7f00a2d6ef2c34ab78175b (diff)
Fix "str object is not callable" error
-rw-r--r--gateway.py7
-rw-r--r--library/printer.py2
2 files changed, 6 insertions, 3 deletions
diff --git a/gateway.py b/gateway.py
index 1048478..05024b0 100644
--- a/gateway.py
+++ b/gateway.py
@@ -263,7 +263,7 @@ class VK(object):
logger.debug("VK initialized (jid: %s)", source)
def __str__(self):
- return ("user id: %s; online: %s; token: %s" %
+ return ("user id: %s; online: %s; token: %s" %
(self.userID, self.online, self.token))
def init(self):
@@ -279,6 +279,8 @@ class VK(object):
try:
int(self.engine.method("isAppUser"))
except (api.VkApiError, TypeError, AttributeError):
+ logger.error("unable to check user's token, error: %s (user: %s)",
+ traceback.format_exc(), self.source)
return False
return True
@@ -291,7 +293,8 @@ class VK(object):
logger.debug("VK going to authenticate (jid: %s)", self.source)
self.engine = api.APIBinding(self.token, DEBUG_API, self.source)
if not self.checkToken():
- raise api.TokenError("The token is invalid (jid: %s, token: %s)" % (self.source, self.token))
+ raise api.TokenError("The token is invalid (jid: %s, token: %s)"
+ % (self.source, self.token))
self.online = True
return True
diff --git a/library/printer.py b/library/printer.py
index 7daac60..5b2f2eb 100644
--- a/library/printer.py
+++ b/library/printer.py
@@ -49,7 +49,7 @@ def Print(text, line=True):
def colorizeJSON(data):
- if os.name() != "nt":
+ if os.name != "nt":
text = ""
iter = list(repr(data)).__iter__()
for c in iter: