setup.py: retrieve cacert.pem from requests package. Create application compressed archive. Added a fix for requests to support cacert.pem in different locations.

This commit is contained in:
Jose Manuel Delicado
2016-05-08 00:08:40 +02:00
parent 7ad5e6fa37
commit 7fab6bcf54
5 changed files with 28 additions and 4971 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -4,9 +4,10 @@ import sys
import fix_arrow # A few new locales for Three languages in arrow.
import fix_urllib3_warnings # Avoiding some SSL warnings related to Twython.
import fix_win32com
import fix_requests #fix cacert.pem location for TWBlue binary copies
def setup():
fix_arrow.fix()
if hasattr(sys, "frozen"):
fix_win32com.fix()
fix_requests.fix()
fix_urllib3_warnings.fix()

10
src/fixes/fix_requests.py Normal file
View File

@@ -0,0 +1,10 @@
from requests import certs, utils, adapters
import paths
def patched_where():
return paths.app_path(u"cacert.pem")
def fix():
certs.where=patched_where
utils.DEFAULT_CA_BUNDLE_PATH=patched_where()
adapters.DEFAULT_CA_BUNDLE_PATH=patched_where()

View File

@@ -26,6 +26,7 @@ import application
import platform
from glob import glob
import wx
from requests import certs
def get_architecture_files():
if platform.architecture()[0][:2] == "32":
@@ -45,7 +46,7 @@ def get_data():
import enchant
return [
("", ["conf.defaults", "app-configuration.defaults", "icon.ico"]),
("requests", ["cacert.pem"]),
("", [certs.where()]),
("accessible_output2/lib", glob("accessible_output2/lib/*.dll")),
("keys/lib", glob("keys/lib/*.dll")),
("keymaps", glob("keymaps/*.keymap")),
@@ -112,7 +113,7 @@ options = {
'optimize':2,
'packages': ["pubsub", "pubsub.core", "pubsub.core.kwargs", "dbhash"],
'dll_excludes': ["MPR.dll", "api-ms-win-core-apiquery-l1-1-0.dll", "api-ms-win-core-console-l1-1-0.dll", "api-ms-win-core-delayload-l1-1-1.dll", "api-ms-win-core-errorhandling-l1-1-1.dll", "api-ms-win-core-file-l1-2-0.dll", "api-ms-win-core-handle-l1-1-0.dll", "api-ms-win-core-heap-obsolete-l1-1-0.dll", "api-ms-win-core-libraryloader-l1-1-1.dll", "api-ms-win-core-localization-l1-2-0.dll", "api-ms-win-core-processenvironment-l1-2-0.dll", "api-ms-win-core-processthreads-l1-1-1.dll", "api-ms-win-core-profile-l1-1-0.dll", "api-ms-win-core-registry-l1-1-0.dll", "api-ms-win-core-synch-l1-2-0.dll", "api-ms-win-core-sysinfo-l1-2-0.dll", "api-ms-win-security-base-l1-2-0.dll", "api-ms-win-core-heap-l1-2-0.dll", "api-ms-win-core-interlocked-l1-2-0.dll", "api-ms-win-core-localization-obsolete-l1-1-0.dll", "api-ms-win-core-string-l1-1-0.dll", "api-ms-win-core-string-obsolete-l1-1-0.dll", "WLDAP32.dll", "MSVCP90.dll", "CRYPT32.dll", "mfc90.dll"],
'skip_archive': True
'compressed': True
},
},
windows = [