Building and msgpack fixes

- Makefile typo
- pyinstaller rewritten and fixed including and initialisation of
  messagetypes
- msgpack decoding new message display fix
This commit is contained in:
Peter Šurda 2017-02-19 19:48:45 +01:00
parent 67c8966a21
commit 46a2c361de
Signed by: PeterSurda
GPG Key ID: 0C5F50C0B5F37D87
4 changed files with 23 additions and 12 deletions

View File

@ -6,12 +6,8 @@ qtPath = "C:\\Qt-4.8.7\\"
openSSLPath = "C:\\OpenSSL-1.0.2j\\" openSSLPath = "C:\\OpenSSL-1.0.2j\\"
outPath = "C:\\src\\PyInstaller-3.2.1\\bitmessagemain" outPath = "C:\\src\\PyInstaller-3.2.1\\bitmessagemain"
# -*- mode: python -*- messagetypes = []
a = Analysis([srcPath + 'bitmessagemain.py'], hiddenimports= []
pathex=[outPath],
hiddenimports=['messagetypes'],
hookspath=None,
runtime_hooks=None)
# manually add messagetypes directory and its listing # manually add messagetypes directory and its listing
with open(os.path.join(srcPath, 'messagetypes.txt'), 'wt') as f: with open(os.path.join(srcPath, 'messagetypes.txt'), 'wt') as f:
@ -22,7 +18,19 @@ with open(os.path.join(srcPath, 'messagetypes.txt'), 'wt') as f:
if splitted[1] != ".py": if splitted[1] != ".py":
continue continue
f.write(mt + "\n") f.write(mt + "\n")
a.scripts.append((os.path.join('messagetypes', mt), os.path.join(srcPath, 'messagetypes', mt), 'PYMODULE')) hiddenimports.append('messagetypes.' + splitted[0])
messagetypes.append(mt)
# -*- mode: python -*-
a = Analysis([srcPath + 'bitmessagemain.py'],
pathex=[outPath],
hiddenimports=hiddenimports,
hookspath=None,
runtime_hooks=None)
for mt in messagetypes:
a.scripts.append((os.path.join('messagetypes', mt), os.path.join(srcPath, 'messagetypes', mt), 'PYMODULE'))
a.datas.append(('messagetypes.txt', os.path.join(srcPath, 'messagetypes.txt'), 'DATA')) a.datas.append(('messagetypes.txt', os.path.join(srcPath, 'messagetypes.txt'), 'DATA'))
# fix duplicates # fix duplicates
@ -37,7 +45,7 @@ def addTranslations():
for file in os.listdir(srcPath + 'translations'): for file in os.listdir(srcPath + 'translations'):
if file[-3:] != ".qm": if file[-3:] != ".qm":
continue continue
extraDatas.append((os.path.join('translations', file), os.path.join(srcPath, 'translations', file) 'DATA')) extraDatas.append((os.path.join('translations', file), os.path.join(srcPath, 'translations', file), 'DATA'))
for file in os.listdir(qtPath + 'translations'): for file in os.listdir(qtPath + 'translations'):
if file[0:3] != "qt_" or file[5:8] != ".qm": if file[0:3] != "qt_" or file[5:8] != ".qm":
continue continue
@ -80,4 +88,4 @@ exe = EXE(pyz,
debug=False, debug=False,
strip=None, strip=None,
upx=False, upx=False,
console=False, icon= os.path.join(srcPath, 'images', 'can-icon.ico') console=False, icon= os.path.join(srcPath, 'images', 'can-icon.ico'))

View File

@ -128,7 +128,10 @@ class BMAccount(object):
def parseMessage(self, toAddress, fromAddress, subject, message): def parseMessage(self, toAddress, fromAddress, subject, message):
self.toAddress = toAddress self.toAddress = toAddress
self.fromAddress = fromAddress self.fromAddress = fromAddress
self.subject = subject if isinstance(subject, unicode):
self.subject = str(subject)
else:
self.subject = subject
self.message = message self.message = message
self.fromLabel = self.getLabel(fromAddress) self.fromLabel = self.getLabel(fromAddress)
self.toLabel = self.getLabel(toAddress) self.toLabel = self.getLabel(toAddress)

View File

@ -6,7 +6,7 @@ else ifeq ($(UNAME_S),MINGW32_NT-6.1)
CCFLAGS += -IC:\OpenSSL-1.0.2j-mingw\include -D_WIN32 -march=native CCFLAGS += -IC:\OpenSSL-1.0.2j-mingw\include -D_WIN32 -march=native
LDFLAGS += -static-libgcc -LC:\OpenSSL-1.0.2j-mingw\lib -lwsock32 -o bitmsghash32.dll -Wl,--out-implib,bitmsghash.a LDFLAGS += -static-libgcc -LC:\OpenSSL-1.0.2j-mingw\lib -lwsock32 -o bitmsghash32.dll -Wl,--out-implib,bitmsghash.a
else else
LDFLAGS += -lpthread -o bigmsghash.so LDFLAGS += -lpthread -o bitmsghash.so
endif endif
all: bitmsghash.so all: bitmsghash.so

View File

@ -31,7 +31,7 @@ def constructObject(data):
mods = [] mods = []
if paths.frozen is not None: if paths.frozen is not None:
with open(path.join(path.dirname(path.dirname(__file__)), 'messagetypes.txt'), 'rt') as f: with open(path.join(path.dirname(path.dirname(__file__)), 'messagetypes.txt'), 'rt') as f:
for m in f.readline(): for m in f.readlines():
mods.append(m.rstrip()) mods.append(m.rstrip())
else: else:
mods = listdir(path.dirname(__file__)) mods = listdir(path.dirname(__file__))