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 untrusted user: 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\\"
outPath = "C:\\src\\PyInstaller-3.2.1\\bitmessagemain"
# -*- mode: python -*-
a = Analysis([srcPath + 'bitmessagemain.py'],
pathex=[outPath],
hiddenimports=['messagetypes'],
hookspath=None,
runtime_hooks=None)
messagetypes = []
hiddenimports= []
# manually add messagetypes directory and its listing
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":
continue
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'))
# fix duplicates
@ -37,7 +45,7 @@ def addTranslations():
for file in os.listdir(srcPath + 'translations'):
if file[-3:] != ".qm":
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'):
if file[0:3] != "qt_" or file[5:8] != ".qm":
continue
@ -80,4 +88,4 @@ exe = EXE(pyz,
debug=False,
strip=None,
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):
self.toAddress = toAddress
self.fromAddress = fromAddress
self.subject = subject
if isinstance(subject, unicode):
self.subject = str(subject)
else:
self.subject = subject
self.message = message
self.fromLabel = self.getLabel(fromAddress)
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
LDFLAGS += -static-libgcc -LC:\OpenSSL-1.0.2j-mingw\lib -lwsock32 -o bitmsghash32.dll -Wl,--out-implib,bitmsghash.a
else
LDFLAGS += -lpthread -o bigmsghash.so
LDFLAGS += -lpthread -o bitmsghash.so
endif
all: bitmsghash.so

View File

@ -31,7 +31,7 @@ def constructObject(data):
mods = []
if paths.frozen is not None:
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())
else:
mods = listdir(path.dirname(__file__))