From 19a0a69d8c2534462b99f47ed175e85047fe421c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20Cort=C3=A9z?= Date: Fri, 7 Nov 2014 04:29:57 -0600 Subject: [PATCH] 15 bugs have been fixed --- contributors.txt | 3 +- src/Conf.defaults | 3 +- src/gui/buffers/user_searches.py | 5 +- src/gui/main.py | 29 ++++---- src/issueReporter/__init__.py | 0 src/issueReporter/constants.py | 21 ------ src/issueReporter/get_logs.py | 32 -------- src/issueReporter/gui.py | 124 ------------------------------- src/keystrokeEditor/constants.py | 1 + src/twython/streaming/api.py | 1 + 10 files changed, 26 insertions(+), 193 deletions(-) delete mode 100644 src/issueReporter/__init__.py delete mode 100644 src/issueReporter/constants.py delete mode 100644 src/issueReporter/get_logs.py delete mode 100644 src/issueReporter/gui.py diff --git a/contributors.txt b/contributors.txt index ef2039e0..71eb6673 100644 --- a/contributors.txt +++ b/contributors.txt @@ -30,4 +30,5 @@ Michael Lau Paris-Apps Salvadora Melguizo Holly Scott-Gardner -Anibal Hernández \ No newline at end of file +Anibal Hernández +Sussan Leiva \ No newline at end of file diff --git a/src/Conf.defaults b/src/Conf.defaults index c07ba643..3b64695f 100644 --- a/src/Conf.defaults +++ b/src/Conf.defaults @@ -14,6 +14,7 @@ max_tweets_per_call = integer(default=100) reverse_timelines = boolean(default=False) time_to_check_streams = integer(default=30) announce_stream_status = boolean(default=True) +auto_connect_streams = boolean(default=True) [sound] volume = float(default=1.0) @@ -85,4 +86,4 @@ search = string(default="control+win+-") edit_keystrokes = string(default="control+win+k") view_user_lists = string(default="control+win+l") get_more_items = string(default="alt+win+pageup") -connect_streams = string(default="win+alt+c") \ No newline at end of file +connect_streams = string(default="win+alt+s") \ No newline at end of file diff --git a/src/gui/buffers/user_searches.py b/src/gui/buffers/user_searches.py index 1ce972e6..83748936 100644 --- a/src/gui/buffers/user_searches.py +++ b/src/gui/buffers/user_searches.py @@ -58,4 +58,7 @@ class searchUsersPanel(peoplePanel): self.db.settings.pop(self.name_buffer) pos = self.db.settings["buffers"].index(self.name_buffer) self.db.settings["buffers"].remove(self.name_buffer) - return pos \ No newline at end of file + return pos + + def get_more_items(self): + output.speak(_(u"This action is not supported for this buffer")) \ No newline at end of file diff --git a/src/gui/main.py b/src/gui/main.py index 396e345c..0ee2e33b 100644 --- a/src/gui/main.py +++ b/src/gui/main.py @@ -33,7 +33,6 @@ import platform import urllib2 import sysTrayIcon import languageHandler -from issueReporter import gui as issueReporterGUI from sessionmanager import manager from mysc import event from mysc.thread_utils import call_threaded @@ -124,6 +123,8 @@ class mainFrame(wx.Frame): # buffer menu buffer = wx.Menu() + load_more_items = buffer.Append(wx.NewId(), _(u"Load more items")) + self.Bind(wx.EVT_MENU, self.get_more_items, load_more_items) mute = buffer.Append(wx.NewId(), _(u"&Mute")) self.Bind(wx.EVT_MENU, self.toggle_mute, mute) autoread = buffer.Append(wx.NewId(), _(u"&Autoread tweets for this buffer")) @@ -342,8 +343,9 @@ class mainFrame(wx.Frame): if run_streams == True: self.get_home() self.get_tls() - self.check_streams = RepeatingTimer(config.main["general"]["time_to_check_streams"], self.check_stream_up) - self.check_streams.start() + if config.main["general"]["auto_connect_streams"] == True: + self.check_streams = RepeatingTimer(config.main["general"]["time_to_check_streams"], self.check_stream_up) + self.check_streams.start() # If all it's done, then play a nice sound saying that all it's OK. sound.player.play("ready.ogg") @@ -368,15 +370,15 @@ class mainFrame(wx.Frame): def setup_twitter(self, panel): """ Setting up the connection for twitter, or authenticate if the config file has valid credentials.""" -# try: - self.twitter.login(self.user_key, self.user_secret) - self.logging_in_twblue(panel) - log.info("Authorized in Twitter.") - del self.user_key; del self.user_secret -# except: -# dlg1 = wx.MessageDialog(panel, _(u"Connection error. Try again later."), _(u"Error!"), wx.ICON_ERROR) -# dlg1.ShowModal() -# self.Close(True) + try: + self.twitter.login(self.user_key, self.user_secret) + self.logging_in_twblue(panel) + log.info("Authorized in Twitter.") + del self.user_key; del self.user_secret + except: + dlg1 = wx.MessageDialog(panel, _(u"Connection error. Try again later."), _(u"Error!"), wx.ICON_ERROR) + dlg1.ShowModal() + self.Close(True) def get_home(self): """ Gets the home stream, that manages home timeline, mentions, direct messages and sent.""" @@ -545,7 +547,8 @@ class mainFrame(wx.Frame): webbrowser.open("http://twblue.com.mx") def onReportBug(self, ev): - issueReporterGUI.reportBug(self.db.settings["user_name"]).ShowModal() + webbrowser.open("https://github.com/manuelcortez/TWBlue/issues") +# issueReporterGUI.reportBug(self.db.settings["user_name"]).ShowModal() def onCheckForUpdates(self, ev): updater.update_manager.check_for_update(msg=True) diff --git a/src/issueReporter/__init__.py b/src/issueReporter/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/src/issueReporter/constants.py b/src/issueReporter/constants.py deleted file mode 100644 index c228d285..00000000 --- a/src/issueReporter/constants.py +++ /dev/null @@ -1,21 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################ -# Copyright (c) 2013, 2014 Manuel Eduardo Cortéz Vallejo -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . -# -############################################################ -categories = ["General"] -reproducibilities = ["always", "sometimes", "random", "have not tried", "unable to duplicate"] -severities = ["block", "crash", "major", "minor", "tweak", "text", "trivial", "feature"] diff --git a/src/issueReporter/get_logs.py b/src/issueReporter/get_logs.py deleted file mode 100644 index faad2b02..00000000 --- a/src/issueReporter/get_logs.py +++ /dev/null @@ -1,32 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################ -# Copyright (c) 2013, 2014 Manuel Eduardo Cortéz Vallejo -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . -# -############################################################ -import paths -import os - -def get_logs_files(): - files = {} - for i in os.listdir(paths.logs_path()): - if i == "debug.log": continue - f = open(paths.logs_path(i), "r") - files[i] = f.readlines() - f.close() - try: os.remove(paths.logs_path("tracebacks.log")) - except: pass - return files - diff --git a/src/issueReporter/gui.py b/src/issueReporter/gui.py deleted file mode 100644 index a65693ea..00000000 --- a/src/issueReporter/gui.py +++ /dev/null @@ -1,124 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################ -# Copyright (c) 2013, 2014 Manuel Eduardo Cortéz Vallejo -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . -# -############################################################ -import wx -import application -from suds.client import Client -import constants - -class reportBug(wx.Dialog): - def __init__(self, user_name): - self.user = "informador" - self.user_name = user_name - self.password = "contrasena" - self.url = application.report_bugs_url - self.categories = [_(u"General")] - self.reproducibilities = [_(u"always"), _(u"sometimes"), _(u"random"), _(u"have not tried"), _(u"unable to duplicate")] - self.severities = [_(u"block"), _(u"crash"), _(u"major"), _(u"minor"), _(u"tweak"), _(u"text"), _(u"trivial"), _(u"feature")] - wx.Dialog.__init__(self, None, -1) - self.SetTitle(_(u"Report an error")) - panel = wx.Panel(self) - sizer = wx.BoxSizer(wx.VERTICAL) - categoryLabel = wx.StaticText(panel, -1, _(u"Select a category"), size=wx.DefaultSize) - self.category = wx.ComboBox(panel, -1, choices=self.categories, style=wx.CB_READONLY) - self.category.SetSize(self.category.GetBestSize()) - self.category.SetSelection(0) - categoryB = wx.BoxSizer(wx.HORIZONTAL) - categoryB.Add(categoryLabel, 0, wx.ALL, 5) - categoryB.Add(self.category, 0, wx.ALL, 5) - self.category.SetFocus() - sizer.Add(categoryB, 0, wx.ALL, 5) - summaryLabel = wx.StaticText(panel, -1, _(u"Briefly describe what happened. You will be able to thoroughly explain it later"), size=wx.DefaultSize) - self.summary = wx.TextCtrl(panel, -1) - dc = wx.WindowDC(self.summary) - dc.SetFont(self.summary.GetFont()) - self.summary.SetSize(dc.GetTextExtent("a"*80)) -# self.summary.SetFocus() - summaryB = wx.BoxSizer(wx.HORIZONTAL) - summaryB.Add(summaryLabel, 0, wx.ALL, 5) - summaryB.Add(self.summary, 0, wx.ALL, 5) - sizer.Add(summaryB, 0, wx.ALL, 5) - descriptionLabel = wx.StaticText(panel, -1, _(u"Here, you can describe the bug in detail"), size=wx.DefaultSize) - self.description = wx.TextCtrl(panel, -1, style=wx.TE_MULTILINE) - dc = wx.WindowDC(self.description) - dc.SetFont(self.description.GetFont()) - (x, y, z) = dc.GetMultiLineTextExtent("0"*2000) - self.description.SetSize((x, y)) - descBox = wx.BoxSizer(wx.HORIZONTAL) - descBox.Add(descriptionLabel, 0, wx.ALL, 5) - descBox.Add(self.description, 0, wx.ALL, 5) - sizer.Add(descBox, 0, wx.ALL, 5) - reproducibilityLabel = wx.StaticText(panel, -1, _(u"how often does this bug happen?"), size=wx.DefaultSize) - self.reproducibility = wx.ComboBox(panel, -1, choices=self.reproducibilities, style=wx.CB_READONLY) - self.reproducibility.SetSelection(3) - self.reproducibility.SetSize(self.reproducibility.GetBestSize()) - reprB = wx.BoxSizer(wx.HORIZONTAL) - reprB.Add(reproducibilityLabel, 0, wx.ALL, 5) - reprB.Add(self.reproducibility, 0, wx.ALL, 5) - sizer.Add(reprB, 0, wx.ALL, 5) - severityLabel = wx.StaticText(panel, -1, _(u"Select the importance that you think this bug has")) - self.severity = wx.ComboBox(panel, -1, choices=self.severities, style=wx.CB_READONLY) - self.severity.SetSize(self.severity.GetBestSize()) - self.severity.SetSelection(3) - severityB = wx.BoxSizer(wx.HORIZONTAL) - severityB.Add(severityLabel, 0, wx.ALL, 5) - severityB.Add(self.severity, 0, wx.ALL, 5) - sizer.Add(severityB, 0, wx.ALL, 5) - self.agree = wx.CheckBox(panel, -1, _(u"I know that the TW Blue bug system will get my Twitter username to contact me and fix the bug quickly")) - self.agree.SetValue(False) - sizer.Add(self.agree, 0, wx.ALL, 5) - ok = wx.Button(panel, wx.ID_OK, _(u"Send report")) - ok.Bind(wx.EVT_BUTTON, self.onSend) - ok.SetDefault() - cancel = wx.Button(panel, wx.ID_CANCEL, _(u"Cancel")) - btnBox = wx.BoxSizer(wx.HORIZONTAL) - btnBox.Add(ok, 0, wx.ALL, 5) - btnBox.Add(cancel, 0, wx.ALL, 5) - sizer.Add(btnBox, 0, wx.ALL, 5) - panel.SetSizer(sizer) - self.SetClientSize(sizer.CalcMin()) - - def onSend(self, ev): - if self.summary.GetValue() == "" or self.description.GetValue() == "": - wx.MessageDialog(self, _(u"You must fill out both fields"), _(u"Error"), wx.OK|wx.ICON_ERROR).ShowModal() - return - if self.agree.GetValue() == False: - wx.MessageDialog(self, _(u"You need to mark the checkbox to provide us your twitter username to contact to you if is necessary."), _(u"Error"), wx.ICON_ERROR).ShowModal() - return - try: - client = Client(self.url) - issue = client.factory.create('IssueData') - issue.project.name = "TW Blue" - issue.project.id = 0 - issue.summary = self.summary.GetValue(), - issue.description = "Reported by @%s\n\n" % (self.user_name) + self.description.GetValue() - issue.category = constants.categories[self.category.GetSelection()] - issue.reproducibility.name = constants.reproducibilities[self.reproducibility.GetSelection()] - issue.severity.name = constants.severities[self.severity.GetSelection()] - issue.priority.name = "normal" - issue.view_state.name = "public" - issue.resolution.name = "open" - issue.projection.name = "none" - issue.eta.name = "eta" - issue.status.name = "new" - id = client.service.mc_issue_add(self.user, self.password, issue) - wx.MessageDialog(self, _(u"Thanks for reporting this bug! In future versions, you may be able to find it in the changes list. You've reported the bug number %i") % (id), _(u"reported"), wx.OK).ShowModal() - self.EndModal(wx.ID_OK) - except: - wx.MessageDialog(self, _(u"Something unexpected occurred while trying to report the bug. Please, try again later"), _(u"Error while reporting"), wx.ICON_ERROR|wx.OK).ShowModal() - self.EndModal(wx.ID_CANCEL) \ No newline at end of file diff --git a/src/keystrokeEditor/constants.py b/src/keystrokeEditor/constants.py index c2b2a6fa..caee148a 100644 --- a/src/keystrokeEditor/constants.py +++ b/src/keystrokeEditor/constants.py @@ -41,4 +41,5 @@ actions = { "search": _(u"Search on twitter"), "edit_keystrokes": _(u"Shows the keystroke editor"), "view_user_lists": _(u"Show lists for a specified user"), +"get_more_items": _(u"Load previous item for a buffer"), } \ No newline at end of file diff --git a/src/twython/streaming/api.py b/src/twython/streaming/api.py index 47678e47..f74f22e4 100644 --- a/src/twython/streaming/api.py +++ b/src/twython/streaming/api.py @@ -124,6 +124,7 @@ class TwythonStreamer(object): except requests.exceptions.Timeout: self.on_timeout() else: +# self.connected = False if response.status_code != 200: self.on_error(response.status_code, response.content)