Fixes to logger function calls
This commit is contained in:
parent
0f357529ed
commit
26b82984a2
|
@ -40,7 +40,7 @@ from debug import logger
|
||||||
import sys
|
import sys
|
||||||
if sys.platform == 'darwin':
|
if sys.platform == 'darwin':
|
||||||
if float("{1}.{2}".format(*sys.version_info)) < 7.5:
|
if float("{1}.{2}".format(*sys.version_info)) < 7.5:
|
||||||
logger.critical("You should use python 2.7.5 or greater. Your version: {0}.{1}.{2}".format(*sys.version_info))
|
logger.critical("You should use python 2.7.5 or greater. Your version: %s", format(*sys.version_info))
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
|
|
||||||
def connectToStream(streamNumber):
|
def connectToStream(streamNumber):
|
||||||
|
@ -278,7 +278,7 @@ class MySimpleXMLRPCRequestHandler(SimpleXMLRPCRequestHandler):
|
||||||
if numberOfAddresses > 999:
|
if numberOfAddresses > 999:
|
||||||
return 'API Error 0005: You have (accidentally?) specified too many addresses to make. Maximum 999. This check only exists to prevent mischief; if you really want to create more addresses than this, contact the Bitmessage developers and we can modify the check or you can do it yourself by searching the source code for this message.'
|
return 'API Error 0005: You have (accidentally?) specified too many addresses to make. Maximum 999. This check only exists to prevent mischief; if you really want to create more addresses than this, contact the Bitmessage developers and we can modify the check or you can do it yourself by searching the source code for this message.'
|
||||||
shared.apiAddressGeneratorReturnQueue.queue.clear()
|
shared.apiAddressGeneratorReturnQueue.queue.clear()
|
||||||
logger.debug('Requesting that the addressGenerator create', numberOfAddresses, 'addresses.')
|
logger.debug('Requesting that the addressGenerator create %s addresses.', numberOfAddresses)
|
||||||
shared.addressGeneratorQueue.put(
|
shared.addressGeneratorQueue.put(
|
||||||
('createDeterministicAddresses', addressVersionNumber, streamNumber,
|
('createDeterministicAddresses', addressVersionNumber, streamNumber,
|
||||||
'unused API address', numberOfAddresses, passphrase, eighteenByteRipe, nonceTrialsPerByte, payloadLengthExtraBytes))
|
'unused API address', numberOfAddresses, passphrase, eighteenByteRipe, nonceTrialsPerByte, payloadLengthExtraBytes))
|
||||||
|
@ -304,7 +304,7 @@ class MySimpleXMLRPCRequestHandler(SimpleXMLRPCRequestHandler):
|
||||||
if streamNumber != 1:
|
if streamNumber != 1:
|
||||||
return 'API Error 0003: The stream number must be 1. Others aren\'t supported.'
|
return 'API Error 0003: The stream number must be 1. Others aren\'t supported.'
|
||||||
shared.apiAddressGeneratorReturnQueue.queue.clear()
|
shared.apiAddressGeneratorReturnQueue.queue.clear()
|
||||||
logger.debug('Requesting that the addressGenerator create', numberOfAddresses, 'addresses.')
|
logger.debug('Requesting that the addressGenerator create %s addresses.', numberOfAddresses)
|
||||||
shared.addressGeneratorQueue.put(
|
shared.addressGeneratorQueue.put(
|
||||||
('getDeterministicAddress', addressVersionNumber,
|
('getDeterministicAddress', addressVersionNumber,
|
||||||
streamNumber, 'unused API address', numberOfAddresses, passphrase, eighteenByteRipe))
|
streamNumber, 'unused API address', numberOfAddresses, passphrase, eighteenByteRipe))
|
||||||
|
@ -517,7 +517,7 @@ class MySimpleXMLRPCRequestHandler(SimpleXMLRPCRequestHandler):
|
||||||
status, addressVersionNumber, streamNumber, toRipe = decodeAddress(
|
status, addressVersionNumber, streamNumber, toRipe = decodeAddress(
|
||||||
toAddress)
|
toAddress)
|
||||||
if status != 'success':
|
if status != 'success':
|
||||||
logger.warn('API Error 0007: Could not decode address:', toAddress, ':', status)
|
logger.warn('API Error 0007: Could not decode address: %s : %s', toAddress, status)
|
||||||
|
|
||||||
if status == 'checksumfailed':
|
if status == 'checksumfailed':
|
||||||
return 'API Error 0008: Checksum failed for address: ' + toAddress
|
return 'API Error 0008: Checksum failed for address: ' + toAddress
|
||||||
|
@ -533,7 +533,7 @@ class MySimpleXMLRPCRequestHandler(SimpleXMLRPCRequestHandler):
|
||||||
status, addressVersionNumber, streamNumber, fromRipe = decodeAddress(
|
status, addressVersionNumber, streamNumber, fromRipe = decodeAddress(
|
||||||
fromAddress)
|
fromAddress)
|
||||||
if status != 'success':
|
if status != 'success':
|
||||||
logger.warn('API Error 0007: Could not decode address:', fromAddress, ':', status)
|
logger.warn('API Error 0007: Could not decode address: %s : %s', fromAddress, status)
|
||||||
|
|
||||||
if status == 'checksumfailed':
|
if status == 'checksumfailed':
|
||||||
return 'API Error 0008: Checksum failed for address: ' + fromAddress
|
return 'API Error 0008: Checksum failed for address: ' + fromAddress
|
||||||
|
@ -597,7 +597,7 @@ class MySimpleXMLRPCRequestHandler(SimpleXMLRPCRequestHandler):
|
||||||
status, addressVersionNumber, streamNumber, fromRipe = decodeAddress(
|
status, addressVersionNumber, streamNumber, fromRipe = decodeAddress(
|
||||||
fromAddress)
|
fromAddress)
|
||||||
if status != 'success':
|
if status != 'success':
|
||||||
logger.warn('API Error 0007: Could not decode address:', fromAddress, ':', status)
|
logger.warn('API Error 0007: Could not decode address: %s : %s', fromAddress, status)
|
||||||
|
|
||||||
if status == 'checksumfailed':
|
if status == 'checksumfailed':
|
||||||
return 'API Error 0008: Checksum failed for address: ' + fromAddress
|
return 'API Error 0008: Checksum failed for address: ' + fromAddress
|
||||||
|
@ -667,7 +667,7 @@ class MySimpleXMLRPCRequestHandler(SimpleXMLRPCRequestHandler):
|
||||||
status, addressVersionNumber, streamNumber, toRipe = decodeAddress(
|
status, addressVersionNumber, streamNumber, toRipe = decodeAddress(
|
||||||
address)
|
address)
|
||||||
if status != 'success':
|
if status != 'success':
|
||||||
logger.warn('API Error 0007: Could not decode address:', address, ':', status)
|
logger.warn('API Error 0007: Could not decode address: %s : %s', address, status)
|
||||||
|
|
||||||
if status == 'checksumfailed':
|
if status == 'checksumfailed':
|
||||||
return 'API Error 0008: Checksum failed for address: ' + address
|
return 'API Error 0008: Checksum failed for address: ' + address
|
||||||
|
@ -806,7 +806,7 @@ if __name__ == "__main__":
|
||||||
except:
|
except:
|
||||||
apiNotifyPath = ''
|
apiNotifyPath = ''
|
||||||
if apiNotifyPath != '':
|
if apiNotifyPath != '':
|
||||||
logger.debug('Trying to call', apiNotifyPath)
|
logger.debug('Trying to call %s', apiNotifyPath)
|
||||||
|
|
||||||
call([apiNotifyPath, "startingUp"])
|
call([apiNotifyPath, "startingUp"])
|
||||||
singleAPIThread = singleAPI()
|
singleAPIThread = singleAPI()
|
||||||
|
@ -825,7 +825,7 @@ if __name__ == "__main__":
|
||||||
from PyQt4 import QtCore, QtGui
|
from PyQt4 import QtCore, QtGui
|
||||||
except Exception as err:
|
except Exception as err:
|
||||||
logger.error('PyBitmessage requires PyQt unless you want to run it as a daemon and interact with it using the API. You can download PyQt from http://www.riverbankcomputing.com/software/pyqt/download or by searching Google for \'PyQt Download\'. If you want to run in daemon mode, see https://bitmessage.org/wiki/Daemon')
|
logger.error('PyBitmessage requires PyQt unless you want to run it as a daemon and interact with it using the API. You can download PyQt from http://www.riverbankcomputing.com/software/pyqt/download or by searching Google for \'PyQt Download\'. If you want to run in daemon mode, see https://bitmessage.org/wiki/Daemon')
|
||||||
logger.error('Error message: '+ err)
|
logger.error('Error message: %s', err)
|
||||||
os._exit(0)
|
os._exit(0)
|
||||||
|
|
||||||
import bitmessageqt
|
import bitmessageqt
|
||||||
|
|
Reference in New Issue
Block a user