diff --git a/arch.sh b/arch.sh index 386974e7..6502f21a 100755 --- a/arch.sh +++ b/arch.sh @@ -1,5 +1,6 @@ #!/bin/bash +GIT_APP=PyBitmessage APP=pybitmessage PREV_VERSION=0.4.1 VERSION=0.4.1 @@ -25,24 +26,12 @@ make clean rm -f archpackage/*.gz # having the root directory called name-version seems essential -mv ../${APP} ../${APP}-${VERSION} +mv ../${GIT_APP} ../${APP}-${VERSION} tar -cvzf ${SOURCE} ../${APP}-${VERSION} --exclude-vcs # rename the root directory without the version number -mv ../${APP}-${VERSION} ../${APP} +mv ../${APP}-${VERSION} ../${GIT_APP} # calculate the MD5 checksum CHECKSM=$(md5sum ${SOURCE}) sed -i "s/md5sums[^)]*)/md5sums=(${CHECKSM%% *})/g" archpackage/PKGBUILD - -cd archpackage - -# Create the package -tar -c -f ${APP}-${VERSION}.pkg.tar . -sync -xz ${APP}-${VERSION}.pkg.tar -sync - -# Move back to the original directory -cd ${CURRDIR} - diff --git a/archpackage/PKGBUILD b/archpackage/PKGBUILD index 76657030..2a0e25ac 100644 --- a/archpackage/PKGBUILD +++ b/archpackage/PKGBUILD @@ -19,7 +19,7 @@ install= changelog= source=($pkgname-$pkgver.tar.gz) noextract=() -md5sums=(0ee9bcb11dc606788fde94c7857e8720) +md5sums=(ebf89129571571198473559b4b2e552c) build() { cd "$srcdir/$pkgname-$pkgver" ./configure --prefix=/usr diff --git a/debian/changelog b/debian/changelog index a8f35473..8cdaff2c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,58 +1,3 @@ -pybitmessage (0.4.0-1) raring; urgency=low - - * Raised default demanded difficulty from 1 to 2 for new addresses - * Added v4 addresses: - pubkeys are now encrypted and tagged in the inventory - * Use locks when accessing dictionary inventory - * Refactored the way inv and addr messages are shared - * Give user feedback when disk is full - * Added chan true/false to listAddresses results - * When replying using chan address, send to whole chan not just sender - * Refactored of the way PyBitmessage looks for interesting new objects - in large inv messages from peers - * Show inventory lookup rate on Network Status tab - * Added SqlBulkExecute class - so we can update inventory with only one commit - * Updated Russian translations - * Move duplicated SQL code into helper - * Allow specification of alternate settings dir - via BITMESSAGE_HOME environment variable - * Removed use of gevent. Removed class_bgWorker.py - * Added Sip and PyQt to includes in build_osx.py - * Show number of each message type processed - in the API command clientStatus - * Use fast PoW - unless we're explicitly a frozen (binary) version of the code - * Enable user-set localization in settings - * Fix Archlinux package creation - * Fallback to language only localization when region doesn't match - * Fixed brew install instructions - * Added German translation - * Made inbox and sent messages table panels read-only - * Allow inbox and sent preview panels to resize - * Count RE: as a reply header, just like Re: so we don't chain Re: RE: - * Fix for traceback on OSX - * Added backend ability to understand shorter addresses - * Convert 'API Error' to raise APIError() - * Added option in settings to allow sending to a mobile device - (app not yet done) - * Added ability to start daemon mode when using Bitmessage as a module - * Improved the way client detects locale - * Added API commands: - getInboxMessageIds, getSentMessageIds, listAddressBookEntries, - trashSentMessageByAckData, addAddressBookEntry, - deleteAddressBookEntry, listAddresses2, listSubscriptions - * Set a maximum frequency for playing sounds - * Show Invalid Method error in same format as other API errors - * Update status of separate broadcasts separately - even if the sent data is identical - * Added Namecoin integration - * Internally distinguish peers by IP and port - * Inbox message retrieval API - functions now also returns read status - - -- Bob Mottram (4096 bits) Sat, 28 September 2013 09:54:00 +0100 - pybitmessage (0.3.5-1) raring; urgency=low * Inbox message retrieval API functions now also returns read status diff --git a/debian/control b/debian/control index 8f5c75d8..6fb419f4 100644 --- a/debian/control +++ b/debian/control @@ -9,7 +9,7 @@ Vcs-Git: https://github.com/Bitmessage/PyBitmessage.git Package: pybitmessage Architecture: all -Depends: ${shlibs:Depends}, ${misc:Depends}, ${python:Depends}, python (>= 2.7), openssl, python-qt4, libqt4-dev (>= 4.8.0), python-qt4-dev, sqlite3, libsqlite3-dev, gst123 +Depends: ${shlibs:Depends}, ${misc:Depends}, python (>= 2.7.0), openssl, python-qt4, libqt4-dev (>= 4.8.0), python-qt4-dev, sqlite3, libsqlite3-dev, gst123 Suggests: libmessaging-menu-dev Description: Send encrypted messages Bitmessage is a P2P communications protocol used to send encrypted diff --git a/generate.sh b/generate.sh index 00aad16e..58d0b5e2 100755 --- a/generate.sh +++ b/generate.sh @@ -7,16 +7,25 @@ rm -f Makefile rpmpackage/*.spec packagemonkey -n "PyBitmessage" --version "0.4.1" --dir "." -l "mit" \ -e "Bob Mottram (4096 bits) " \ --brief "Send encrypted messages" \ - --desc "Bitmessage is a P2P communications protocol used to send encrypted messages to another person or to many subscribers. It is decentralized and trustless, meaning that you need-not inherently trust any entities like root certificate authorities. It uses strong authentication which means that the sender of a message cannot be spoofed, and it aims to hide \"non-content\" data, like the sender and receiver of messages, from passive eavesdroppers like those running warrantless wiretapping programs." \ + --desc "Bitmessage is a P2P communications protocol used to send " \ + "encrypted messages to another person or to many subscribers. It is " \ + "decentralized and trustless, meaning that you need-not inherently" \ + "trust any entities like root certificate authorities. It uses strong " \ + "authentication which means that the sender of a message cannot be" \ + "spoofed, and it aims to hide \"non-content\" data, like the sender and " \ + "receiver of messages, from passive eavesdroppers like those running " \ + "warrantless wiretapping programs." \ --homepage "https://github.com/Bitmessage/PyBitmessage" --section "mail" \ --categories "Office/Email" \ - --dependsdeb "python (>= 2.7), openssl, python-qt4, libqt4-dev (>= 4.8.0), python-qt4-dev, sqlite3, libsqlite3-dev, gst123" \ + --dependsdeb "python (>= 2.7.0), openssl, python-qt4, libqt4-dev " \ + "(>= 4.8.0), python-qt4-dev, sqlite3, libsqlite3-dev, gst123" \ --dependsrpm "python, PyQt4, openssl-compat-bitcoin-libs, gst123" \ --mainscript "bitmessagemain.py" \ --librarypath "/opt/openssl-compat-bitcoin/lib/" \ --suggestsdeb "libmessaging-menu-dev" \ - --dependspuppy "openssl, python-qt4, sqlite3, sqlite3-dev, python-openssl, python-sip, gst123" \ - --dependsarch "python2, qt4, python2-pyqt4, sqlite, openssl, mpg123" \ + --dependspuppy "openssl, python-qt4, sqlite3, sqlite3-dev, " \ + "python-openssl, python-sip, gst123" \ + --dependsarch "python2, qt4, python2-pyqt4, sqlite, openssl, gst123" \ --suggestsarch "python2-gevent: Python network library that uses greenlet and libevent for easy and scalable concurrency" --pythonversion 2 \ --dependsebuild "dev-libs/openssl, dev-python/PyQt4[${PYTHON_USEDEP}]" \ --buildebuild "\${PYTHON_DEPS}" --pythonreq "sqlite" \ diff --git a/osx.sh b/osx.sh index 834a6243..2f59f446 100755 --- a/osx.sh +++ b/osx.sh @@ -14,7 +14,7 @@ fi echo "Creating OS X packages for Bitmessage." -cd src && python2.7 build_osx.py py2app +cd src && python build_osx.py py2app if [[ $? = "0" ]]; then hdiutil create -fs HFS+ -volname "Bitmessage" -srcfolder dist/Bitmessage.app dist/bitmessage-v$1.dmg diff --git a/rpmpackage/pybitmessage.spec b/rpmpackage/pybitmessage.spec index 67332f63..c73b6e15 100644 --- a/rpmpackage/pybitmessage.spec +++ b/rpmpackage/pybitmessage.spec @@ -69,58 +69,6 @@ make install -B DESTDIR=%{buildroot} PREFIX=/usr %attr(644,root,root) /usr/share/icons/hicolor/24x24/apps/%{name}.png %changelog -* Sat Sep 28 2013 Bob Mottram (4096 bits) - 0.4.0-1 -- Raised default demanded difficulty from 1 to 2 for new addresses -- Added v4 addresses: - pubkeys are now encrypted and tagged in the inventory -- Use locks when accessing dictionary inventory -- Refactored the way inv and addr messages are shared -- Give user feedback when disk is full -- Added chan true/false to listAddresses results -- When replying using chan address, send to whole chan not just sender -- Refactored of the way PyBitmessage looks for interesting new objects - in large inv messages from peers -- Show inventory lookup rate on Network Status tab -- Added SqlBulkExecute class - so we can update inventory with only one commit -- Updated Russian translations -- Move duplicated SQL code into helper -- Allow specification of alternate settings dir - via BITMESSAGE_HOME environment variable -- Removed use of gevent. Removed class_bgWorker.py -- Added Sip and PyQt to includes in build_osx.py -- Show number of each message type processed - in the API command clientStatus -- Use fast PoW - unless we're explicitly a frozen (binary) version of the code -- Enable user-set localization in settings -- Fix Archlinux package creation -- Fallback to language only localization when region doesn't match -- Fixed brew install instructions -- Added German translation -- Made inbox and sent messages table panels read-only -- Allow inbox and sent preview panels to resize -- Count RE: as a reply header, just like Re: so we don't chain Re: RE: -- Fix for traceback on OSX -- Added backend ability to understand shorter addresses -- Convert 'API Error' to raise APIError() -- Added option in settings to allow sending to a mobile device - (app not yet done) -- Added ability to start daemon mode when using Bitmessage as a module -- Improved the way client detects locale -- Added API commands: - getInboxMessageIds, getSentMessageIds, listAddressBookEntries, - trashSentMessageByAckData, addAddressBookEntry, - deleteAddressBookEntry, listAddresses2, listSubscriptions -- Set a maximum frequency for playing sounds -- Show Invalid Method error in same format as other API errors -- Update status of separate broadcasts separately - even if the sent data is identical -- Added Namecoin integration -- Internally distinguish peers by IP and port -- Inbox message retrieval API - functions now also returns read status - * Mon Jul 29 2013 Bob Mottram (4096 bits) - 0.3.5-1 - Inbox message retrieval API functions now also returns read status - Added right-click option to mark a message as unread diff --git a/src/bitmessagemain.py b/src/bitmessagemain.py index 90e02cc1..47925a46 100755 --- a/src/bitmessagemain.py +++ b/src/bitmessagemain.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python2.7 # Copyright (c) 2012 Jonathan Warren # Copyright (c) 2012 The Bitmessage developers # Distributed under the MIT/X11 software license. See the accompanying @@ -152,7 +152,7 @@ class MySimpleXMLRPCRequestHandler(SimpleXMLRPCRequestHandler): return text.decode(decode_type) except TypeError as e: raise APIError(22, "Decode error - " + str(e)) - + def _verifyAddress(self, address): status, addressVersionNumber, streamNumber, ripe = decodeAddress(address) if status != 'success': @@ -519,7 +519,7 @@ class MySimpleXMLRPCRequestHandler(SimpleXMLRPCRequestHandler): if len(params) == 0: raise APIError(0, 'I need parameters!') msgid = self._decode(params[0], "hex") - + # Trash if in inbox table helper_inbox.trash(msgid) # Trash if in sent table @@ -740,7 +740,7 @@ class MySimpleXMLRPCRequestHandler(SimpleXMLRPCRequestHandler): trialValue, nonce = proofofwork.run(target, initialHash) print '(For pubkey message via API) Found proof of work', trialValue, 'Nonce:', nonce payload = pack('>Q', nonce) + payload - + pubkeyReadPosition = 8 # bypass the nonce if payload[pubkeyReadPosition:pubkeyReadPosition+4] == '\x00\x00\x00\x00': # if this pubkey uses 8 byte time pubkeyReadPosition += 8 @@ -760,20 +760,20 @@ class MySimpleXMLRPCRequestHandler(SimpleXMLRPCRequestHandler): shared.broadcastToSendDataQueues(( streamNumber, 'advertiseobject', inventoryHash)) elif method == 'getMessageDataByDestinationHash' or method == 'getMessageDataByDestinationTag': - # Method will eventually be used by a particular Android app to + # Method will eventually be used by a particular Android app to # select relevant messages. Do not yet add this to the api # doc. - + if len(params) != 1: raise APIError(0, 'I need 1 parameter!') requestedHash, = params if len(requestedHash) != 32: raise APIError(19, 'The length of hash should be 32 bytes (encoded in hex thus 64 characters).') requestedHash = self._decode(requestedHash, "hex") - - # This is not a particularly commonly used API function. Before we - # use it we'll need to fill out a field in our inventory database - # which is blank by default (first20bytesofencryptedmessage). + + # This is not a particularly commonly used API function. Before we + # use it we'll need to fill out a field in our inventory database + # which is blank by default (first20bytesofencryptedmessage). queryreturn = sqlQuery( '''SELECT hash, payload FROM inventory WHERE tag = '' and objecttype = 'msg' ; ''') with SqlBulkExecute() as sql: @@ -783,7 +783,7 @@ class MySimpleXMLRPCRequestHandler(SimpleXMLRPCRequestHandler): readPosition += decodeVarint(payload[readPosition:readPosition+10])[1] # Stream Number length t = (payload[readPosition:readPosition+32],hash) sql.execute('''UPDATE inventory SET tag=? WHERE hash=?; ''', *t) - + queryreturn = sqlQuery('''SELECT payload FROM inventory WHERE tag = ?''', requestedHash) data = '{"receivedMessageDatas":[' @@ -795,7 +795,7 @@ class MySimpleXMLRPCRequestHandler(SimpleXMLRPCRequestHandler): data += ']}' return data elif method == 'getPubkeyByHash': - # Method will eventually be used by a particular Android app to + # Method will eventually be used by a particular Android app to # retrieve pubkeys. Please do not yet add this to the api docs. if len(params) != 1: raise APIError(0, 'I need 1 parameter!') @@ -937,25 +937,25 @@ class Main: print 'Running as a daemon. You can use Ctrl+C to exit.' while True: time.sleep(20) - + def stop(self): with shared.printLock: print 'Stopping Bitmessage Deamon.' shared.doCleanShutdown() - - + + def getApiAddress(self): if not shared.safeConfigGetBoolean('bitmessagesettings', 'apienabled'): return None address = shared.config.get('bitmessagesettings', 'apiinterface') port = shared.config.getint('bitmessagesettings', 'apiport') return {'address':address,'port':port} - + if __name__ == "__main__": mainprogram = Main() mainprogram.start() - + # So far, the creation of and management of the Bitmessage protocol and this # client is a one-man operation. Bitcoin tips are quite appreciated. # 1H5XaDA6fYENLbknwZyjiYXYPQaFjjLX2u diff --git a/src/bitmessageqt/__init__.py b/src/bitmessageqt/__init__.py index 2bd2bb6b..768e681b 100644 --- a/src/bitmessageqt/__init__.py +++ b/src/bitmessageqt/__init__.py @@ -3234,7 +3234,10 @@ def run(): locale_lang = locale_countrycode[0:2] user_countrycode = str(shared.config.get('bitmessagesettings', 'userlocale')) user_lang = user_countrycode[0:2] - translation_path = "translations/bitmessage_" + try: + translation_path = os.path.join(sys._MEIPASS, "translations/bitmessage_") + except Exception, e: + translation_path = "translations/bitmessage_" if shared.config.get('bitmessagesettings', 'userlocale') == 'system': # try to detect the users locale otherwise fallback to English diff --git a/src/build_osx.py b/src/build_osx.py index 96d46250..109852ef 100644 --- a/src/build_osx.py +++ b/src/build_osx.py @@ -11,7 +11,7 @@ setup( setup_requires = ["py2app"], options = dict( py2app = dict( - resources = ["images", "translations"], + resources = ["images"], includes = ['sip', 'PyQt4._qt'], iconfile = "images/bitmessage.icns" ) diff --git a/src/class_receiveDataThread.py b/src/class_receiveDataThread.py index 59597711..b1a62261 100644 --- a/src/class_receiveDataThread.py +++ b/src/class_receiveDataThread.py @@ -1120,7 +1120,7 @@ class receiveDataThread(threading.Thread): else: # We're using a whitelist queryreturn = sqlQuery( '''SELECT label FROM whitelist where address=? and enabled='1' ''', - toAddress) + fromAddress) if queryreturn == []: print 'Message ignored because address not in whitelist.' blockMessage = True diff --git a/src/translations/bitmessage_de.qm b/src/translations/bitmessage_de.qm index c06e4e42..0e8e68a3 100644 Binary files a/src/translations/bitmessage_de.qm and b/src/translations/bitmessage_de.qm differ diff --git a/src/translations/bitmessage_de.ts b/src/translations/bitmessage_de.ts index 9eb718c3..3814fa86 100644 --- a/src/translations/bitmessage_de.ts +++ b/src/translations/bitmessage_de.ts @@ -1417,7 +1417,7 @@ Die Zufallszahlen-Option ist standard, jedoch haben deterministische Adressen ei Here you may set the maximum amount of work you are willing to do to send a message to another person. Setting these values to 0 means that any value is acceptable. - Hier setzen Sie die maximale Arbeit, die Sie bereit sind zu verrichten, um eine Nachricht an eine andere Person zu versenden. Ein Wert von 0 bedeutet, dass Sie jede Arbeit akzeptieren. + hier setzen Sie die maximale Arbeit die Sie bereit sind zu verrichten um eine Nachricht an eine andere Person zu verwenden. Ein Wert von 0 bedeutet, dass Sie jede Arbeit akzeptieren.