Fixing requests.urllib3 warnings

This commit is contained in:
Manuel Cortez 2015-06-12 12:26:14 -05:00
parent 0c60377082
commit 5467655264
6 changed files with 25 additions and 5 deletions

View File

@ -5,7 +5,7 @@ if snapshot == False:
version = "0.80"
update_url = 'http://twblue.es/updates/twblue_ngen.json'
else:
version = "9.4"
version = "9.5"
update_url = 'http://twblue.es/updates/snapshots_ngen.json'
author = u"Manuel Cortéz, Bill Dengler"
authorEmail = "manuel@manuelcortez.net"

View File

@ -47,8 +47,8 @@ class bufferController(object):
def get_event(self, ev):
if ev.GetKeyCode() == wx.WXK_RETURN and ev.ControlDown(): event = "url"
elif ev.GetKeyCode() == wx.WXK_RETURN: event = "interact"
if ev.GetKeyCode() == wx.WXK_RETURN and ev.ControlDown(): event = "interact"
elif ev.GetKeyCode() == wx.WXK_RETURN: event = "url"
elif ev.GetKeyCode() == wx.WXK_F5: event = "volume_down"
elif ev.GetKeyCode() == wx.WXK_F6: event = "volume_up"
elif ev.GetKeyCode() == wx.WXK_DELETE and ev.ShiftDown(): event = "clear_list"

View File

@ -1,6 +1,12 @@
# -*- coding: utf-8 -*-
""" This module contains some bugfixes for packages used in TWBlue."""
import sys
import fix_arrow # A few new locales for Three languages in arrow.
# import fix_requests_cert_location # For a better compilation in Windows.
import fix_urllib3_warnings # Avoiding some SSL warnings related to Twython.
def setup():
fix_arrow.fix()
# if hasattr(sys, "frozen"):
# fix_requests_cert_location.fix()
fix_urllib3_warnings.fix()

View File

@ -0,0 +1,9 @@
# -*- coding: utf-8 -*-
import paths
def where():
return paths.app_path(r"requests\cacert.pem")
def fix():
from requests import certs
certs.where = where

View File

@ -0,0 +1,5 @@
# -*- coding: utf-8 -*-
from requests.packages import urllib3
def fix():
urllib3.disable_warnings()

View File

@ -51,6 +51,7 @@ log = logging.getLogger("main")
def setup():
log.debug("Starting " + application.name + " %s" % (application.version,))
config.setup()
fixes.setup()
log.debug("Using %s %s" % (platform.system(), platform.architecture()[0]))
log.debug("Application path is %s" % (paths.app_path(),))
log.debug("config path is %s" % (paths.config_path(),))
@ -71,7 +72,6 @@ def setup():
if hasattr(sm.view, "destroy"):
sm.view.destroy()
del sm
fixes.setup()
r = mainController.Controller()
r.view.show()
r.do_work()