def post_gen(self,post,basyo=0): if(config.searchMuteUser(post["user"]["id"])): return if(post["type"]=="repost"): if(config.searchMuteUser(post["post"]["user"]["id"])): return if(post.get("inReplyToPost")): if(config.searchMuteUser(post["inReplyToPost"]["user"]["id"])): return self.posts.append(post) orig_post=None if(post["type"]=="repost"): orig_post=post post=post["post"] self.listctrl.InsertStringItem(basyo,post["user"]["screenName"]) if(post.get("text")): self.listctrl.SetStringItem(basyo,1,post["text"].replace("\r","").replace("\n"," ")) # self.listctrl.SetItemData(basyo,post) if(orig_post): self.listctrl.SetItemBackgroundColour(basyo,wx.Colour(192,255,192)) elif(post.get("inReplyToPost")): self.listctrl.SetItemBackgroundColour(basyo,wx.Colour(255,216,216)) self.listctrl.SetItemData(basyo,len(self.posts)) try: self.listctrl.SetItemImage(basyo,self.get_image_number(config.getTimelineUserURL(post["user"]["avatarUrl"]))) except: return if(config.GetValue("gensun_download")): filemng.cacheAsync(post["user"]["avatarUrl"]) if(post["files"]): for attr_file in post["files"]: filemng.cacheAsync(attr_file["url"]) if(post["files"]): for attr_file in post["files"]: filemng.cacheAsync(config.getThumbnailURL(attr_file["url"]))
def ok_button(ev): try: req=config.misskey.reqr("users/show",{"screen-name":textctrl.GetValue()}) print req except: wx.MessageBox(u"サーバーがダウンしています。",u"エラー - ミュートユーザーを追加 - Misq",wx.ICON_ERROR) else: if(req.get("error")): wx.MessageBox(u"ユーザーが存在しません。",u"エラー - ミュートユーザーを追加 - Misq",wx.ICON_ERROR) else: user_id=req["id"] if(config.searchMuteUser(user_id)): wx.MessageBox(u"すでにミュート済みです",u"エラー - ミュートユーザーを追加 - Misq",wx.ICON_ERROR) else: config.addMuteUser(user_id) wx.MessageBox(u"ミュートしました。\nすでに表示されている物にもミュートを適用したい場合はMisqを再起動してください。",u"お知らせ - ミュートユーザーを追加 - Misq",wx.ICON_INFORMATION) mutes.Append(req["screenName"],req["id"]) frm.Close()