Merge branch 'master' of code.manuelcortez.net:manuelcortez/socializer

This commit is contained in:
Manuel Cortez 2019-02-25 05:31:29 -06:00
commit 305f8317fe
2 changed files with 9 additions and 9 deletions

View File

@ -92,7 +92,7 @@ class baseBuffer(object):
log.error("Error {0}: {1}".format(err.code, err.error)) log.error("Error {0}: {1}".format(err.code, err.error))
retrieved = err.code retrieved = err.code
return retrieved return retrieved
except ReadTimeout as ConnectionError: except:
log.exception("Connection error when updating buffer %s. Will try again in 2 minutes" % (self.name,)) log.exception("Connection error when updating buffer %s. Will try again in 2 minutes" % (self.name,))
return False return False
if not hasattr(self, "tab"): if not hasattr(self, "tab"):
@ -395,7 +395,7 @@ class feedBuffer(baseBuffer):
log.error("Error {0}: {1}".format(err.code, err.error)) log.error("Error {0}: {1}".format(err.code, err.error))
retrieved = err.code retrieved = err.code
return retrieved return retrieved
except ReadTimeout as ConnectionError: except:
log.exception("Connection error when updating buffer %s. Will try again in 2 minutes" % (self.name,)) log.exception("Connection error when updating buffer %s. Will try again in 2 minutes" % (self.name,))
return False return False
if not hasattr(self, "tab"): if not hasattr(self, "tab"):
@ -481,7 +481,7 @@ class communityBuffer(feedBuffer):
if self.can_get_items: if self.can_get_items:
# Strangely, groups.get does not return counters so we need those to show options for loading specific posts for communities. # Strangely, groups.get does not return counters so we need those to show options for loading specific posts for communities.
self.group_info = self.session.vk.client.groups.getById(group_ids=-1*self.kwargs["owner_id"], fields="counters")[0] self.group_info = self.session.vk.client.groups.getById(group_ids=-1*self.kwargs["owner_id"], fields="counters")[0]
print(self.group_info["counters"]) # print(self.group_info["counters"])
super(communityBuffer, self).get_items(*args, **kwargs) super(communityBuffer, self).get_items(*args, **kwargs)
class topicBuffer(feedBuffer): class topicBuffer(feedBuffer):
@ -937,7 +937,7 @@ class chatBuffer(baseBuffer):
log.error("Error {0}: {1}".format(err.code, err.error)) log.error("Error {0}: {1}".format(err.code, err.error))
retrieved = err.code retrieved = err.code
return retrieved return retrieved
except ReadTimeout as ConnectionError: except:
log.exception("Connection error when updating buffer %s. Will try again in 2 minutes" % (self.name,)) log.exception("Connection error when updating buffer %s. Will try again in 2 minutes" % (self.name,))
return False return False
if not hasattr(self, "tab"): if not hasattr(self, "tab"):
@ -1257,7 +1257,7 @@ class requestsBuffer(peopleBuffer):
log.error("Error {0}: {1}".format(err.code, err.error)) log.error("Error {0}: {1}".format(err.code, err.error))
retrieved = err.code retrieved = err.code
return retrieved return retrieved
except ReadTimeout as ConnectionError: except:
log.exception("Connection error when updating buffer %s. Will try again in 2 minutes" % (self.name,)) log.exception("Connection error when updating buffer %s. Will try again in 2 minutes" % (self.name,))
return False return False
num = self.session.get_page(name=self.name, show_nextpage=show_nextpage, endpoint="get", parent_endpoint="users", count=1000, user_ids=", ".join([str(i) for i in ids["items"]]), fields="uid, first_name, last_name, last_seen") num = self.session.get_page(name=self.name, show_nextpage=show_nextpage, endpoint="get", parent_endpoint="users", count=1000, user_ids=", ".join([str(i) for i in ids["items"]]), fields="uid, first_name, last_name, last_seen")

View File

@ -57,7 +57,7 @@ class communityTab(feedTab):
def create_post_buttons(self): def create_post_buttons(self):
self.postBox = wx.StaticBoxSizer(parent=self, orient=wx.HORIZONTAL, label=_("Actions")) self.postBox = wx.StaticBoxSizer(parent=self, orient=wx.HORIZONTAL, label=_("Actions"))
self.load = wx.Button(self.postBox.GetStaticBox(), wx.NewId(), _("Load community")) self.load = wx.Button(self.postBox.GetStaticBox(), wx.NewId(), _("Load buffer"))
self.post = wx.Button(self.postBox.GetStaticBox(), -1, _("&Post")) self.post = wx.Button(self.postBox.GetStaticBox(), -1, _("&Post"))
self.postBox.Add(self.load, 0, wx.ALL, 5) self.postBox.Add(self.load, 0, wx.ALL, 5)
self.postBox.Add(self.post, 0, wx.ALL, 5) self.postBox.Add(self.post, 0, wx.ALL, 5)
@ -85,7 +85,7 @@ class audioAlbumTab(audioTab):
def create_post_buttons(self): def create_post_buttons(self):
self.postBox = wx.StaticBoxSizer(parent=self, orient=wx.HORIZONTAL, label=_("Actions")) self.postBox = wx.StaticBoxSizer(parent=self, orient=wx.HORIZONTAL, label=_("Actions"))
self.load = wx.Button(self.postBox.GetStaticBox(), wx.NewId(), _("Load album")) self.load = wx.Button(self.postBox.GetStaticBox(), wx.NewId(), _("Load buffer"))
self.post = wx.Button(self.postBox.GetStaticBox(), -1, _("&Post")) self.post = wx.Button(self.postBox.GetStaticBox(), -1, _("&Post"))
self.play = wx.Button(self.postBox.GetStaticBox(), -1, _("P&lay")) self.play = wx.Button(self.postBox.GetStaticBox(), -1, _("P&lay"))
self.play_all = wx.Button(self.postBox.GetStaticBox(), -1, _("Play &All")) self.play_all = wx.Button(self.postBox.GetStaticBox(), -1, _("Play &All"))
@ -162,7 +162,7 @@ class documentCommunityTab(homeTab):
class documentTab(documentCommunityTab): class documentTab(documentCommunityTab):
def create_post_buttons(self): def create_post_buttons(self):
self.postBox = wx.StaticBoxSizer(parent=self, orient=wx.HORIZONTAL, label=_("Actions")) self.postBox = wx.StaticBoxSizer(parent=self, orient=wx.HORIZONTAL, label=_("Actions"))
self.load = wx.Button(self.postBox.GetStaticBox(), wx.NewId(), _("Load album")) self.load = wx.Button(self.postBox.GetStaticBox(), wx.NewId(), _("Load buffer"))
self.post = wx.Button(self.postBox.GetStaticBox(), -1, _("&Post")) self.post = wx.Button(self.postBox.GetStaticBox(), -1, _("&Post"))
self.postBox.Add(self.load, 0, wx.ALL, 5) self.postBox.Add(self.load, 0, wx.ALL, 5)
self.postBox.Add(self.post, 0, wx.ALL, 5) self.postBox.Add(self.post, 0, wx.ALL, 5)
@ -280,7 +280,7 @@ class videoAlbumTab(videoTab):
def create_post_buttons(self): def create_post_buttons(self):
self.postBox = wx.BoxSizer(parent=self, orient=wx.HORIZONTAL, label=_("Actions")) self.postBox = wx.BoxSizer(parent=self, orient=wx.HORIZONTAL, label=_("Actions"))
self.load = wx.Button(self.postBox.GetStaticBox(), wx.NewId(), _("Load album")) self.load = wx.Button(self.postBox.GetStaticBox(), wx.NewId(), _("Load buffer"))
self.post = wx.Button(self.postBox.GetStaticBox(), -1, _("&Post")) self.post = wx.Button(self.postBox.GetStaticBox(), -1, _("&Post"))
self.play = wx.Button(self.postBox.GetStaticBox(), -1, _("P&lay")) self.play = wx.Button(self.postBox.GetStaticBox(), -1, _("P&lay"))
self.postBox.Add(self.post, 0, wx.ALL, 5) self.postBox.Add(self.post, 0, wx.ALL, 5)