Fixes to logger function calls

This commit is contained in:
Jordan Hall 2013-08-07 21:12:32 +01:00
parent 0f357529ed
commit 26b82984a2

View File

@ -40,7 +40,7 @@ from debug import logger
import sys
if sys.platform == 'darwin':
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)
def connectToStream(streamNumber):
@ -278,7 +278,7 @@ class MySimpleXMLRPCRequestHandler(SimpleXMLRPCRequestHandler):
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.'
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(
('createDeterministicAddresses', addressVersionNumber, streamNumber,
'unused API address', numberOfAddresses, passphrase, eighteenByteRipe, nonceTrialsPerByte, payloadLengthExtraBytes))
@ -304,7 +304,7 @@ class MySimpleXMLRPCRequestHandler(SimpleXMLRPCRequestHandler):
if streamNumber != 1:
return 'API Error 0003: The stream number must be 1. Others aren\'t supported.'
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(
('getDeterministicAddress', addressVersionNumber,
streamNumber, 'unused API address', numberOfAddresses, passphrase, eighteenByteRipe))
@ -517,7 +517,7 @@ class MySimpleXMLRPCRequestHandler(SimpleXMLRPCRequestHandler):
status, addressVersionNumber, streamNumber, toRipe = decodeAddress(
toAddress)
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':
return 'API Error 0008: Checksum failed for address: ' + toAddress
@ -533,7 +533,7 @@ class MySimpleXMLRPCRequestHandler(SimpleXMLRPCRequestHandler):
status, addressVersionNumber, streamNumber, fromRipe = decodeAddress(
fromAddress)
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':
return 'API Error 0008: Checksum failed for address: ' + fromAddress
@ -597,7 +597,7 @@ class MySimpleXMLRPCRequestHandler(SimpleXMLRPCRequestHandler):
status, addressVersionNumber, streamNumber, fromRipe = decodeAddress(
fromAddress)
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':
return 'API Error 0008: Checksum failed for address: ' + fromAddress
@ -667,7 +667,7 @@ class MySimpleXMLRPCRequestHandler(SimpleXMLRPCRequestHandler):
status, addressVersionNumber, streamNumber, toRipe = decodeAddress(
address)
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':
return 'API Error 0008: Checksum failed for address: ' + address
@ -806,7 +806,7 @@ if __name__ == "__main__":
except:
apiNotifyPath = ''
if apiNotifyPath != '':
logger.debug('Trying to call', apiNotifyPath)
logger.debug('Trying to call %s', apiNotifyPath)
call([apiNotifyPath, "startingUp"])
singleAPIThread = singleAPI()
@ -825,7 +825,7 @@ if __name__ == "__main__":
from PyQt4 import QtCore, QtGui
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('Error message: '+ err)
logger.error('Error message: %s', err)
os._exit(0)
import bitmessageqt