Merge pull request #280 from RemideZ/master

macOSX compatibility
This commit is contained in:
Jonathan Warren 2013-07-05 15:29:07 -07:00
commit a3d21dc880
3 changed files with 18 additions and 3 deletions

View File

@ -35,6 +35,13 @@ from class_addressGenerator import *
import helper_startup
import helper_bootstrap
import sys
if sys.platform == 'darwin':
if float( "{1}.{2}".format(*sys.version_info) ) < 7.5:
print "You should use python 2.7.5 or greater."
print "Your version: {0}.{1}.{2}".format(*sys.version_info)
sys.exit(0)
def connectToStream(streamNumber):
selfInitiatedConnections[streamNumber] = {}
if sys.platform[0:3] == 'win':

View File

@ -2954,8 +2954,11 @@ def run():
app = QtGui.QApplication(sys.argv)
translator = QtCore.QTranslator()
translator.load("translations/bitmessage_" + str(locale.getlocale()[0]))
#translator.load("translations/bitmessage_fr_BE") # Try French instead
try:
translator.load("translations/bitmessage_" + str(locale.getlocale()[0]))
except:
# The above is not compatible with all versions of OSX.
translator.load("translations/bitmessage_en_US") # Default to english.
QtGui.QApplication.installTranslator(translator)
app.setStyleSheet("QStatusBar::item { border: 0px solid black }")

View File

@ -289,7 +289,12 @@ class _OpenSSL:
self.HMAC.argtypes = [ctypes.c_void_p, ctypes.c_void_p, ctypes.c_int,
ctypes.c_void_p, ctypes.c_int, ctypes.c_void_p, ctypes.c_void_p]
self.PKCS5_PBKDF2_HMAC = self._lib.PKCS5_PBKDF2_HMAC
try:
self.PKCS5_PBKDF2_HMAC = self._lib.PKCS5_PBKDF2_HMAC
except:
# The above is not compatible with all versions of OSX.
self.PKCS5_PBKDF2_HMAC = self._lib.PKCS5_PBKDF2_HMAC_SHA1
self.PKCS5_PBKDF2_HMAC.restype = ctypes.c_int
self.PKCS5_PBKDF2_HMAC.argtypes = [ctypes.c_void_p, ctypes.c_int,
ctypes.c_void_p, ctypes.c_int,