Skip to content

Commit f8c955e

Browse files
committed
Merge branch 'master' of https://github.com/Bitmessage/PyBitmessage into keyfile_perm_fix
2 parents eba0878 + a3d21dc commit f8c955e

16 files changed

Lines changed: 754 additions & 589 deletions

Makefile

Lines changed: 26 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,43 @@
11
APP=pybitmessage
22
VERSION=0.3.4
3-
DEST_SHARE=$(DESTDIR)/usr/share
4-
DEST_APP=$(DEST_SHARE)/$(APP)
3+
DEST_SHARE=${DESTDIR}/usr/share
4+
DEST_APP=${DEST_SHARE}/${APP}
55

66
all:
77

88
debug:
99

1010
source:
11-
tar -cvzf ../$(APP)_$(VERSION).orig.tar.gz ../$(APP)-$(VERSION) --exclude-vcs
11+
tar -cvzf ../${APP}_${VERSION}.orig.tar.gz ../${APP}-${VERSION} --exclude-vcs
1212

1313
install:
14-
mkdir -m 755 -p $(DESTDIR)/usr/bin
15-
mkdir -m 755 -p $(DEST_APP)
16-
mkdir -m 755 -p $(DEST_SHARE)/applications
17-
mkdir -m 755 -p $(DEST_APP)/images
18-
mkdir -m 755 -p $(DEST_APP)/pyelliptic
19-
mkdir -m 755 -p $(DEST_APP)/socks
20-
mkdir -m 755 -p $(DEST_APP)/bitmessageqt
21-
mkdir -m 755 -p $(DEST_APP)/translations
22-
mkdir -m 755 -p $(DEST_SHARE)/pixmaps
23-
mkdir -m 755 -p $(DEST_SHARE)/icons
24-
mkdir -m 755 -p $(DEST_SHARE)/icons/hicolor
25-
mkdir -m 755 -p $(DEST_SHARE)/icons/hicolor/scalable
26-
mkdir -m 755 -p $(DEST_SHARE)/icons/hicolor/scalable/apps
27-
mkdir -m 755 -p $(DEST_SHARE)/icons/hicolor/24x24
28-
mkdir -m 755 -p $(DEST_SHARE)/icons/hicolor/24x24/apps
14+
mkdir -m 755 -p ${DESTDIR}/usr/bin
15+
mkdir -m 755 -p ${DEST_APP}
16+
mkdir -m 755 -p ${DEST_SHARE}/applications
17+
mkdir -m 755 -p ${DEST_APP}/images
18+
mkdir -m 755 -p ${DEST_APP}/pyelliptic
19+
mkdir -m 755 -p ${DEST_APP}/socks
20+
mkdir -m 755 -p ${DEST_APP}/bitmessageqt
21+
mkdir -m 755 -p ${DEST_APP}/translations
22+
mkdir -m 755 -p ${DEST_SHARE}/pixmaps
23+
mkdir -m 755 -p ${DEST_SHARE}/icons
24+
mkdir -m 755 -p ${DEST_SHARE}/icons/hicolor
25+
mkdir -m 755 -p ${DEST_SHARE}/icons/hicolor/scalable
26+
mkdir -m 755 -p ${DEST_SHARE}/icons/hicolor/scalable/apps
27+
mkdir -m 755 -p ${DEST_SHARE}/icons/hicolor/24x24
28+
mkdir -m 755 -p ${DEST_SHARE}/icons/hicolor/24x24/apps
2929

30-
install -m 644 src/*.ui $(DEST_APP)
31-
install -m 644 src/*.py $(DEST_APP)
32-
install -m 644 src/*.qrc $(DEST_APP)
30+
cp -r src/* ${DEST_APP}
31+
install -m 755 debian/pybm ${DESTDIR}/usr/bin/${APP}
3332

34-
install -m 644 src/images/*.png $(DEST_APP)/images
35-
install -m 644 src/images/*.ico $(DEST_APP)/images
36-
install -m 644 src/pyelliptic/*.py $(DEST_APP)/pyelliptic
37-
install -m 644 src/socks/*.py $(DEST_APP)/socks
38-
install -m 644 src/bitmessageqt/*.py $(DEST_APP)/bitmessageqt
39-
install -m 644 src/translations/*.qm $(DEST_APP)/translations
40-
install -m 755 debian/pybm $(DESTDIR)/usr/bin/$(APP)
41-
42-
install -m 644 desktop/$(APP).desktop $(DEST_SHARE)/applications/$(APP).desktop
43-
install -m 644 src/images/can-icon-24px.png $(DEST_SHARE)/icons/hicolor/24x24/apps/$(APP).png
44-
install -m 644 desktop/can-icon.svg $(DEST_SHARE)/icons/hicolor/scalable/apps/$(APP).svg
45-
install -m 644 desktop/can-icon.svg $(DEST_SHARE)/pixmaps/$(APP).svg
33+
install -m 644 desktop/${APP}.desktop ${DEST_SHARE}/applications/${APP}.desktop
34+
install -m 644 src/images/can-icon-24px.png ${DEST_SHARE}/icons/hicolor/24x24/apps/${APP}.png
35+
install -m 644 desktop/can-icon.svg ${DEST_SHARE}/icons/hicolor/scalable/apps/${APP}.svg
36+
install -m 644 desktop/can-icon.svg ${DEST_SHARE}/pixmaps/${APP}.svg
4637

4738
clean:
48-
rm -rf debian/$(APP)
49-
rm -f ../$(APP)_*.deb ../$(APP)_*.asc ../$(APP)_*.dsc ../$(APP)*.changes
39+
rm -rf debian/${APP}
40+
rm -f ../${APP}_*.deb ../${APP}_*.asc ../${APP}_*.dsc ../${APP}*.changes
5041
rm -f *.sh~ src/*.pyc src/socks/*.pyc src/pyelliptic/*.pyc
5142
rm -f *.deb \#* \.#* debian/*.log debian/*.substvars
5243
rm -f Makefile~

debian.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
APP=pybitmessage
1010
PREV_VERSION=0.3.3
1111
VERSION=0.3.4
12+
RELEASE=1
1213
ARCH_TYPE=all
1314

1415
#update version numbers automatically - so you don't have to
@@ -27,5 +28,5 @@ dpkg-buildpackage -A
2728
# change the directory name back
2829
mv ../${APP}-${VERSION} ../PyBitmessage
2930

30-
gpg -ba ../${APP}_${VERSION}-1_${ARCH_TYPE}.deb
31+
gpg -ba ../${APP}_${VERSION}-${RELEASE}_${ARCH_TYPE}.deb
3132
gpg -ba ../${APP}_${VERSION}.orig.tar.gz

debian/changelog

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,33 @@
1+
pybitmessage (0.3.4-1) raring; urgency=low
2+
3+
* Switched addr, msg, broadcast, and getpubkey message types
4+
to 8 byte time. Last remaining type is pubkey.
5+
* Added tooltips to show the full subject of messages
6+
* Added Maximum Acceptable Difficulty fields in the settings
7+
* Send out pubkey immediately after generating deterministic
8+
addresses rather than waiting for a request
9+
10+
-- Bob Mottram (4096 bits) <bob@robotics.uk.to> Sun, 30 June 2013 11:23:00 +0100
11+
12+
pybitmessage (0.3.3-1) raring; urgency=low
13+
14+
* Remove inbox item from GUI when using API command trashMessage
15+
* Add missing trailing semicolons to pybitmessage.desktop
16+
* Ensure $(DESTDIR)/usr/bin exists
17+
* Update Makefile to correct sandbox violations when built
18+
via Portage (Gentoo)
19+
* Fix message authentication bug
20+
21+
-- Bob Mottram (4096 bits) <bob@robotics.uk.to> Sun, 30 June 2013 11:23:00 +0100
22+
23+
pybitmessage (0.3.211-1) raring; urgency=low
24+
25+
* Removed multi-core proof of work
26+
as the multiprocessing module does not work well with
27+
pyinstaller's --onefile option.
28+
29+
-- Bob Mottram (4096 bits) <bob@robotics.uk.to> Sun, 30 June 2013 11:23:00 +0100
30+
131
pybitmessage (0.3.2-1) raring; urgency=low
232

333
* Bugfix: Remove remaining references to the old myapp.trayIcon

debian/rules

Lines changed: 29 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
#!/usr/bin/make -f
22
APP=pybitmessage
3-
4-
DEST_MAIN=$(CURDIR)/debian/$(APP)/usr/bin
5-
DEST_SHARE=$(CURDIR)/debian/$(APP)/usr/share
6-
DEST_APP=$(DEST_SHARE)/$(APP)
3+
DESTDIR=${CURDIR}/debian/${APP}
4+
DEST_SHARE=${DESTDIR}/usr/share
5+
DEST_APP=${DEST_SHARE}/${APP}
76

87
build: build-stamp
98
make
9+
build-arch: build-stamp
10+
build-indep: build-stamp
1011
build-stamp:
1112
dh_testdir
1213
touch build-stamp
@@ -15,50 +16,43 @@ clean:
1516
dh_testroot
1617
rm -f build-stamp
1718
dh_clean
18-
install: build clean
19+
install:
1920
dh_testdir
2021
dh_testroot
2122
dh_prep
23+
dh_clean -k
2224
dh_installdirs
2325

24-
mkdir -m 755 -p $(CURDIR)/debian/$(APP)/usr
25-
mkdir -m 755 -p $(CURDIR)/debian/$(APP)/usr/bin
26-
mkdir -m 755 -p $(DEST_APP)
27-
mkdir -m 755 -p $(DEST_SHARE)/applications
28-
mkdir -m 755 -p $(DEST_APP)/images
29-
mkdir -m 755 -p $(DEST_APP)/pyelliptic
30-
mkdir -m 755 -p $(DEST_APP)/socks
31-
mkdir -m 755 -p $(DEST_APP)/bitmessageqt
32-
mkdir -m 755 -p $(DEST_SHARE)/pixmaps
33-
mkdir -m 755 -p $(DEST_SHARE)/icons
34-
mkdir -m 755 -p $(DEST_SHARE)/icons/hicolor
35-
mkdir -m 755 -p $(DEST_SHARE)/icons/hicolor/scalable
36-
mkdir -m 755 -p $(DEST_SHARE)/icons/hicolor/scalable/apps
37-
mkdir -m 755 -p $(DEST_SHARE)/icons/hicolor/24x24
38-
mkdir -m 755 -p $(DEST_SHARE)/icons/hicolor/24x24/apps
26+
mkdir -m 755 -p ${DESTDIR}/usr/bin
27+
mkdir -m 755 -p ${DEST_APP}
28+
mkdir -m 755 -p ${DEST_SHARE}/applications
29+
mkdir -m 755 -p ${DEST_APP}/images
30+
mkdir -m 755 -p ${DEST_APP}/pyelliptic
31+
mkdir -m 755 -p ${DEST_APP}/socks
32+
mkdir -m 755 -p ${DEST_APP}/bitmessageqt
33+
mkdir -m 755 -p ${DEST_APP}/translations
34+
mkdir -m 755 -p ${DEST_SHARE}/pixmaps
35+
mkdir -m 755 -p ${DEST_SHARE}/icons
36+
mkdir -m 755 -p ${DEST_SHARE}/icons/hicolor
37+
mkdir -m 755 -p ${DEST_SHARE}/icons/hicolor/scalable
38+
mkdir -m 755 -p ${DEST_SHARE}/icons/hicolor/scalable/apps
39+
mkdir -m 755 -p ${DEST_SHARE}/icons/hicolor/24x24
40+
mkdir -m 755 -p ${DEST_SHARE}/icons/hicolor/24x24/apps
3941

40-
install -m 644 $(CURDIR)/src/*.ui $(DEST_APP)
41-
install -m 644 $(CURDIR)/src/*.py $(DEST_APP)
42-
install -m 644 $(CURDIR)/src/*.qrc $(DEST_APP)
42+
cp -r src/* ${DEST_APP}
43+
install -m 755 debian/pybm ${DESTDIR}/usr/bin/${APP}
4344

44-
install -m 644 $(CURDIR)/src/images/*.png $(DEST_APP)/images
45-
install -m 644 $(CURDIR)/src/images/*.ico $(DEST_APP)/images
46-
install -m 644 $(CURDIR)/src/pyelliptic/*.py $(DEST_APP)/pyelliptic
47-
install -m 644 $(CURDIR)/src/socks/*.py $(DEST_APP)/socks
48-
install -m 644 $(CURDIR)/src/bitmessageqt/*.py $(DEST_APP)/bitmessageqt
49-
install -m 755 $(CURDIR)/debian/pybm $(DEST_MAIN)/pybitmessage
45+
install -m 644 desktop/${APP}.desktop ${DEST_SHARE}/applications/${APP}.desktop
46+
install -m 644 src/images/can-icon-24px.png ${DEST_SHARE}/icons/hicolor/24x24/apps/${APP}.png
47+
install -m 644 desktop/can-icon.svg ${DEST_SHARE}/icons/hicolor/scalable/apps/${APP}.svg
48+
install -m 644 desktop/can-icon.svg ${DEST_SHARE}/pixmaps/${APP}.svg
5049

51-
install -m 644 $(CURDIR)/desktop/$(APP).desktop $(DEST_SHARE)/applications/$(APP).desktop
52-
install -m 644 $(CURDIR)/src/images/can-icon-24px.png $(DEST_SHARE)/icons/hicolor/24x24/apps/$(APP).png
53-
install -m 644 $(CURDIR)/desktop/can-icon.svg $(DEST_SHARE)/icons/hicolor/scalable/apps/$(APP).svg
54-
install -m 644 $(CURDIR)/desktop/can-icon.svg $(DEST_SHARE)/pixmaps/$(APP).svg
5550
binary-indep: build install
5651
dh_shlibdeps
5752
dh_testdir
5853
dh_testroot
5954
dh_installchangelogs
6055
dh_installdocs
61-
# dh_installexamples
6256
# dh_installman
6357
dh_link
6458
dh_compress
@@ -68,5 +62,5 @@ binary-indep: build install
6862
dh_md5sums
6963
dh_builddeb
7064
binary-arch: build install
71-
binary: binary-indep
65+
binary: binary-indep binary-arch
7266
.PHONY: build clean binary-indep binary install

src/bitmessagemain.py

Lines changed: 31 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@
1010
# The software version variable is now held in shared.py
1111

1212
#import ctypes
13+
try:
14+
from gevent import monkey
15+
monkey.patch_all()
16+
except ImportError as ex:
17+
print "cannot find gevent"
18+
1319
import signal # Used to capture a Ctrl-C keypress so that Bitmessage can shutdown gracefully.
1420
# The next 3 are used for the API
1521
from SimpleXMLRPCServer import *
@@ -29,6 +35,13 @@
2935
import helper_startup
3036
import helper_bootstrap
3137

38+
import sys
39+
if sys.platform == 'darwin':
40+
if float( "{1}.{2}".format(*sys.version_info) ) < 7.5:
41+
print "You should use python 2.7.5 or greater."
42+
print "Your version: {0}.{1}.{2}".format(*sys.version_info)
43+
sys.exit(0)
44+
3245
def connectToStream(streamNumber):
3346
selfInitiatedConnections[streamNumber] = {}
3447
if sys.platform[0:3] == 'win':
@@ -459,9 +472,9 @@ def _dispatch(self, method, params):
459472
status, addressVersionNumber, streamNumber, toRipe = decodeAddress(
460473
toAddress)
461474
if status != 'success':
462-
shared.printLock.acquire()
463-
print 'API Error 0007: Could not decode address:', toAddress, ':', status
464-
shared.printLock.release()
475+
with shared.printLock:
476+
print 'API Error 0007: Could not decode address:', toAddress, ':', status
477+
465478
if status == 'checksumfailed':
466479
return 'API Error 0008: Checksum failed for address: ' + toAddress
467480
if status == 'invalidcharacters':
@@ -476,9 +489,9 @@ def _dispatch(self, method, params):
476489
status, addressVersionNumber, streamNumber, fromRipe = decodeAddress(
477490
fromAddress)
478491
if status != 'success':
479-
shared.printLock.acquire()
480-
print 'API Error 0007: Could not decode address:', fromAddress, ':', status
481-
shared.printLock.release()
492+
with shared.printLock:
493+
print 'API Error 0007: Could not decode address:', fromAddress, ':', status
494+
482495
if status == 'checksumfailed':
483496
return 'API Error 0008: Checksum failed for address: ' + fromAddress
484497
if status == 'invalidcharacters':
@@ -541,9 +554,9 @@ def _dispatch(self, method, params):
541554
status, addressVersionNumber, streamNumber, fromRipe = decodeAddress(
542555
fromAddress)
543556
if status != 'success':
544-
shared.printLock.acquire()
545-
print 'API Error 0007: Could not decode address:', fromAddress, ':', status
546-
shared.printLock.release()
557+
with shared.printLock:
558+
print 'API Error 0007: Could not decode address:', fromAddress, ':', status
559+
547560
if status == 'checksumfailed':
548561
return 'API Error 0008: Checksum failed for address: ' + fromAddress
549562
if status == 'invalidcharacters':
@@ -612,9 +625,9 @@ def _dispatch(self, method, params):
612625
status, addressVersionNumber, streamNumber, toRipe = decodeAddress(
613626
address)
614627
if status != 'success':
615-
shared.printLock.acquire()
616-
print 'API Error 0007: Could not decode address:', address, ':', status
617-
shared.printLock.release()
628+
with shared.printLock:
629+
print 'API Error 0007: Could not decode address:', address, ':', status
630+
618631
if status == 'checksumfailed':
619632
return 'API Error 0008: Checksum failed for address: ' + address
620633
if status == 'invalidcharacters':
@@ -741,9 +754,9 @@ def run(self):
741754
except:
742755
apiNotifyPath = ''
743756
if apiNotifyPath != '':
744-
shared.printLock.acquire()
745-
print 'Trying to call', apiNotifyPath
746-
shared.printLock.release()
757+
with shared.printLock:
758+
print 'Trying to call', apiNotifyPath
759+
747760
call([apiNotifyPath, "startingUp"])
748761
singleAPIThread = singleAPI()
749762
singleAPIThread.daemon = True # close the main program even if there are threads left
@@ -774,9 +787,9 @@ def run(self):
774787
import bitmessageqt
775788
bitmessageqt.run()
776789
else:
777-
shared.printLock.acquire()
778-
print 'Running as a daemon. You can use Ctrl+C to exit.'
779-
shared.printLock.release()
790+
with shared.printLock:
791+
print 'Running as a daemon. You can use Ctrl+C to exit.'
792+
780793
while True:
781794
time.sleep(20)
782795

0 commit comments

Comments
 (0)