From da4cf1f1cb4d05ef89c07ff58f3fdea3c7a8b273 Mon Sep 17 00:00:00 2001 From: Jonathan Warren Date: Thu, 2 May 2013 16:05:31 -0400 Subject: [PATCH] further deamon-related changes --- src/bitmessagemain.py | 6 +++--- src/bitmessageqt/__init__.py | 2 +- src/shared.py | 3 ++- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/bitmessagemain.py b/src/bitmessagemain.py index 76dd0d7d..dd42d824 100755 --- a/src/bitmessagemain.py +++ b/src/bitmessagemain.py @@ -6,7 +6,7 @@ #Right now, PyBitmessage only support connecting to stream 1. It doesn't yet contain logic to expand into further streams. -softwareVersion = '0.3.0' +#The software version variable is now held in shared.py verbose = 1 maximumAgeOfAnObjectThatIAmWillingToAccept = 216000 #Equals two days and 12 hours. lengthOfTimeToLeaveObjectsInInventory = 237600 #Equals two days and 18 hours. This should be longer than maximumAgeOfAnObjectThatIAmWillingToAccept so that we don't process messages twice. @@ -2237,7 +2237,7 @@ def pointMult(secret): def assembleVersionMessage(remoteHost,remotePort,myStreamNumber): - global softwareVersion + shared.softwareVersion payload = '' payload += pack('>L',2) #protocol version. payload += pack('>q',1) #bitflags of the services I offer. @@ -2253,7 +2253,7 @@ def assembleVersionMessage(remoteHost,remotePort,myStreamNumber): random.seed() payload += eightBytesOfRandomDataUsedToDetectConnectionsToSelf - userAgent = '/PyBitmessage:' + softwareVersion + '/' #Length of userAgent must be less than 253. + userAgent = '/PyBitmessage:' + shared.softwareVersion + '/' #Length of userAgent must be less than 253. payload += pack('>B',len(userAgent)) #user agent string length. If the user agent is more than 252 bytes long, this code isn't going to work. payload += userAgent payload += encodeVarint(1) #The number of streams about which I care. PyBitmessage currently only supports 1 per connection. diff --git a/src/bitmessageqt/__init__.py b/src/bitmessageqt/__init__.py index 13e11ec1..65d2e64c 100644 --- a/src/bitmessageqt/__init__.py +++ b/src/bitmessageqt/__init__.py @@ -1732,7 +1732,7 @@ class aboutDialog(QtGui.QDialog): self.ui = Ui_aboutDialog() self.ui.setupUi(self) self.parent = parent - self.ui.labelVersion.setText('version ' + softwareVersion) + self.ui.labelVersion.setText('version ' + shared.softwareVersion) class regenerateAddressesDialog(QtGui.QDialog): def __init__(self,parent): diff --git a/src/shared.py b/src/shared.py index 1c1bb4ad..a4e26682 100644 --- a/src/shared.py +++ b/src/shared.py @@ -1,5 +1,6 @@ -import threading +softwareVersion = '0.3.0' +import threading import sys from addresses import * import highlevelcrypto