Merge branch 'v0.6' of https://github.com/surbhicis/PyBitmessage into py3porting

This commit is contained in:
surbhicis 2020-06-28 13:51:45 +05:30
commit b38790ef43
Signed by untrusted user: surbhicis
GPG Key ID: 48A8C2D218DE7B0B

View File

@ -4,6 +4,7 @@ This module setting file is for settings
import ConfigParser import ConfigParser
import os import os
import sys import sys
import tempfile
from PyQt4 import QtCore, QtGui from PyQt4 import QtCore, QtGui
@ -15,7 +16,6 @@ import openclpow
import paths import paths
import queues import queues
import state import state
import tempfile
import widgets import widgets
from bmconfigparser import BMConfigParser from bmconfigparser import BMConfigParser
from helper_sql import sqlExecute, sqlStoredProcedure from helper_sql import sqlExecute, sqlStoredProcedure
@ -30,7 +30,7 @@ def getSOCKSProxyType(config):
result = ConfigParser.SafeConfigParser.get( result = ConfigParser.SafeConfigParser.get(
config, 'bitmessagesettings', 'socksproxytype') config, 'bitmessagesettings', 'socksproxytype')
except (ConfigParser.NoSectionError, ConfigParser.NoOptionError): except (ConfigParser.NoSectionError, ConfigParser.NoOptionError):
return return None
else: else:
if result.lower() in ('', 'none', 'false'): if result.lower() in ('', 'none', 'false'):
result = None result = None
@ -436,8 +436,7 @@ class SettingsDialog(QtGui.QDialog):
'bitmessagesettings', 'maxacceptablenoncetrialsperbyte' 'bitmessagesettings', 'maxacceptablenoncetrialsperbyte'
) != str(int( ) != str(int(
float(self.lineEditMaxAcceptableTotalDifficulty.text()) float(self.lineEditMaxAcceptableTotalDifficulty.text())
* defaults.networkDefaultProofOfWorkNonceTrialsPerByte) * defaults.networkDefaultProofOfWorkNonceTrialsPerByte)):
):
# the user changed the max acceptable total difficulty # the user changed the max acceptable total difficulty
acceptableDifficultyChanged = True acceptableDifficultyChanged = True
self.config.set( self.config.set(
@ -454,8 +453,7 @@ class SettingsDialog(QtGui.QDialog):
'bitmessagesettings', 'maxacceptablepayloadlengthextrabytes' 'bitmessagesettings', 'maxacceptablepayloadlengthextrabytes'
) != str(int( ) != str(int(
float(self.lineEditMaxAcceptableSmallMessageDifficulty.text()) float(self.lineEditMaxAcceptableSmallMessageDifficulty.text())
* defaults.networkDefaultPayloadLengthExtraBytes) * defaults.networkDefaultPayloadLengthExtraBytes)):
):
# the user changed the max acceptable small message difficulty # the user changed the max acceptable small message difficulty
acceptableDifficultyChanged = True acceptableDifficultyChanged = True
self.config.set( self.config.set(