Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Runnable with both Python3 and Python2, with both PyQt5 and PyQt4 by using Qt.py #2250

Open
wants to merge 127 commits into
base: v0.6
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
127 commits
Select commit Hold shift + click to select a range
01e5400
tr compatible with all Qt APIs
g1itch Mar 3, 2021
b9fca03
Prepare newchandialog module for PyQt5/qtpy
g1itch Mar 3, 2021
8dca39e
Initial support for PyQt5 (main window shown) using QtPy package.
g1itch Feb 15, 2018
58466d5
Changes for pyside:
g1itch Feb 19, 2018
07c2a51
Module support rewrite:
g1itch Feb 21, 2018
1cae520
Better formatting of connections table header
g1itch Feb 22, 2018
3202082
No more arg() call on result of _translate()
g1itch Feb 22, 2018
c5de33d
QComboBox.findData() compatible with pyside
g1itch Feb 23, 2018
5f4b67a
fromAddress - str, subject - unicode
g1itch Feb 26, 2018
acaa274
QWheelEvent.orientation() is obsolete, used angleDelta() instead
g1itch Mar 1, 2018
c39c7d1
Changed check_pyqt() to work with qtpy
g1itch Jun 27, 2018
bc89000
Handled pylint warnings in bitmessageqt, qidenticon, depends,
g1itch Nov 16, 2018
6864b44
PyQt5 based qtpy fallback
g1itch Feb 11, 2019
b046898
Explicitly set wordWrap property to false in STableWidgets
g1itch Apr 12, 2019
46d8576
Suppressed pylint relative-import and pycodestyle E402 in depends
g1itch Apr 24, 2019
677c117
Don't close BitmessageQtApplication.server in __del__()
g1itch Sep 1, 2020
3e39852
Removed unused resources in ui-files
g1itch Sep 14, 2020
782010f
Changes for PyInstaller to build with qtpy and PyQt4
g1itch Oct 20, 2020
4480d5d
winbuild.sh script: additional packages
g1itch Oct 20, 2020
229cf1d
Fix tray icon changing upon notification
g1itch Feb 19, 2021
d75d388
Sorted imports in __init__ and removed import from debug
g1itch Feb 27, 2021
caec943
Replace unicode() by .decode() in bitmessageqt.foldertree
g1itch May 8, 2021
6fd07a0
bitmessageqt.account: replace unicode() by .decode() and format
g1itch May 8, 2021
e57a4fa
bitmessageqt.__init__: removed or replaced unicode(), formatted a bit
g1itch May 8, 2021
5acee0c
Remove redundant unicode() in plugins.indicator_libmessaging
g1itch May 8, 2021
2f8734d
Change depends in stdeb.cfg
g1itch Jun 9, 2021
9a1424c
qtpy based fallback for PyQt5
g1itch Oct 7, 2021
ced7b4d
Fix UnicodeEncodeError in bitmessageqt.blacklist when deleting an entry
g1itch Nov 19, 2021
327a539
Replace removed cmp parameter of list.sort() by key in getSortedAccou…
g1itch Nov 29, 2021
a049681
Fix imports in bitmessageqt.tests
g1itch Nov 29, 2021
d9fb640
Add python-qtpy into appimage recipe to build with Qt4
g1itch Dec 15, 2021
1434768
Try to fix the issue with XKB in appimage by adding xkb-data package
g1itch Dec 15, 2021
9910556
Add "Ubuntu 20" key to depends.PACKAGES['qtpy'] dict
g1itch Dec 15, 2021
1368013
Remove rebasing artifact in depends
g1itch Dec 15, 2021
72ba0b6
make runnable with OpenSSL 3 in addition to other versions
kashikoibumi May 20, 2024
aa9edcb
Merge branch 'v0.6' into qt5-wip
kashikoibumi May 21, 2024
4cd0df7
use qtpy directly instead of using fallback-PyQt5
kashikoibumi May 22, 2024
f181b85
replace all of arg() occurrences to format()
kashikoibumi May 22, 2024
046a29e
stop using QString
kashikoibumi May 23, 2024
f70aff6
use import paths compatible with both Python2 and Python3
kashikoibumi May 24, 2024
f37a973
use six.PY2 and six.PY3
kashikoibumi May 25, 2024
46d56c7
use six.itervalues(), six.iteritems()
kashikoibumi May 25, 2024
21a7bdb
use six.int2byte(), six.byte2int, six.BytesIO
kashikoibumi May 25, 2024
81a6bdb
use six.assertRaisesRegex, six.assertRegex, six.assertNotRegex
kashikoibumi May 25, 2024
a11df0c
use six.moves
kashikoibumi May 26, 2024
4ee9986
Merge branch 'six' into py3
kashikoibumi May 26, 2024
d4bb580
fix importing collections for Python3
kashikoibumi May 26, 2024
e0c2976
Merge branch 'six' into py3
kashikoibumi May 26, 2024
ba49d32
use binary literals for compatibility to Python3
kashikoibumi May 26, 2024
4309cb3
use buffer() in Python2 and use memoryview in Python3
kashikoibumi May 26, 2024
a4c4338
use bytes() on keys to be hashable in Python3
kashikoibumi May 26, 2024
5ccfd52
Merge branch 'bytes-key' into py3
kashikoibumi May 26, 2024
d04d620
update translation files for using format() instead of arg()
kashikoibumi May 26, 2024
0f858bc
read from and write to SQLite database in binary mode
kashikoibumi May 26, 2024
d38f425
fix address validator to work
kashikoibumi May 26, 2024
96c764b
refined: read from and write to SQLite database in binary mode
kashikoibumi May 27, 2024
2a0d2d3
update translation files for using format() instead of arg()
kashikoibumi May 26, 2024
9c64db0
remove restriction for Python3 and add startup script for Python3
kashikoibumi May 27, 2024
b9bfa51
fix import path compatible with both Python2 and Python3
kashikoibumi May 27, 2024
5fa08f4
misc fixes to run with Python3
kashikoibumi May 27, 2024
6ec9fb1
Merge branch 'binary' into py3
kashikoibumi May 27, 2024
df2631c
misc fixes to run with Python3; part 2
kashikoibumi May 28, 2024
0fa71f2
Merge branch 'openssl3' into py3
kashikoibumi May 28, 2024
10e5563
misc fixes to run with Python3; part 3
kashikoibumi May 28, 2024
c3d083d
Merge branch 'memoryview' into py3
kashikoibumi May 28, 2024
822b90e
fix to connect with TLS in Python3
kashikoibumi May 28, 2024
6637f56
Merge branch 'qt5-wip' into py3qt
kashikoibumi May 29, 2024
2d9d30e
fix one of database compatibility problems; others remained
kashikoibumi May 29, 2024
e5c0654
fix types
kashikoibumi May 29, 2024
c39dd18
fix one of database compatibility problems; others remained
kashikoibumi May 29, 2024
67004f3
Merge branch 'py3' into py3qt
kashikoibumi May 29, 2024
f04a788
fix for newer versions of Python3
kashikoibumi May 30, 2024
d9efe1c
fix for newer versions of Python3
kashikoibumi May 30, 2024
d676ea3
quick workaround for BLOB as TEXT problem (#2247)
kashikoibumi May 30, 2024
35abdf2
Merge branch 'v0.6' into py3
kashikoibumi May 30, 2024
6638e26
Merge branch 'py3' into py3qt
kashikoibumi May 30, 2024
01296a8
Merge branch 'strict-blob' into py3
kashikoibumi May 30, 2024
0795359
fix careless mistakes
kashikoibumi May 30, 2024
31dcbd6
add script to revert BLOB-keys into TEXT-keys
kashikoibumi May 30, 2024
0ff6b43
fix imports
kashikoibumi May 30, 2024
1f092c0
Merge branch 'py3' into py3qt
kashikoibumi May 30, 2024
0739f53
Merge branch 'strict-blob' into py3
kashikoibumi May 30, 2024
e4570cc
Merge branch 'strict-blob' into py3qt
kashikoibumi May 30, 2024
4702dd2
fix TLS configuration bug
kashikoibumi May 30, 2024
f07af4e
fix TLS configuration bug
kashikoibumi May 30, 2024
0acae4c
fix user agent display
kashikoibumi May 30, 2024
05b1294
disable UPnP in Python3 temporally
kashikoibumi May 30, 2024
e166116
disable UPnP in Python3 temporally
kashikoibumi May 30, 2024
6bb138e
use hexlify() to display hash ID
kashikoibumi May 30, 2024
bfda9fe
workaround to invalid tag type
kashikoibumi May 30, 2024
a6e980d
use hexlify() to display hash ID
kashikoibumi May 30, 2024
a1d633d
workaround to invalid tag type
kashikoibumi May 30, 2024
047ee35
fix unexpected label string
kashikoibumi May 30, 2024
08650d5
fix unexpected label string
kashikoibumi May 30, 2024
13c5e67
fix user agent format on debug log
kashikoibumi May 30, 2024
5af72b0
fix user agent format on debug log
kashikoibumi May 30, 2024
1ec1b57
fix to pass tests
kashikoibumi May 31, 2024
5973725
fix to pass tests
kashikoibumi May 31, 2024
c59b9e6
fix bug on dandelion specific with Python3
kashikoibumi May 31, 2024
ba8ccfc
fix bug on dandelion specific with Python3
kashikoibumi May 31, 2024
8c85539
fix bug in chunked database access
kashikoibumi May 31, 2024
a504384
fix bug in responsibility of message list on Qt GUI
kashikoibumi May 31, 2024
f9d2364
fix bug in chunked database access
kashikoibumi May 31, 2024
f8919a8
fix bug in responsibility of message list on Qt GUI
kashikoibumi May 31, 2024
de0cd04
fix SOCKS
kashikoibumi May 31, 2024
9adcd1b
fix SOCKS
kashikoibumi May 31, 2024
13aa12c
fix UPnP to work with Python3
kashikoibumi Jun 1, 2024
d103297
fix UPnP to work with Python3
kashikoibumi Jun 1, 2024
4041fef
fix to be runnable with prctl module in Python3
kashikoibumi Jun 3, 2024
0c110b9
fix to be runnable with prctl module in Python3
kashikoibumi Jun 3, 2024
229644c
fix bug in detecting file system type
kashikoibumi Jun 22, 2024
11ba022
fix bug in detecting file system type
kashikoibumi Jun 22, 2024
bdbe5cc
fix timestamp type mismatch bug
kashikoibumi Jun 24, 2024
cdcffa4
fix timestamp type mismatch bug
kashikoibumi Jun 24, 2024
605f205
fix easy typo #2
kashikoibumi Jun 24, 2024
909b9f2
use SafeConfigParser or ConfigParser, which is available
kashikoibumi Jun 24, 2024
e7b5f29
use SafeConfigParser or ConfigParser, which is available
kashikoibumi Jun 24, 2024
45d1c62
add comments
kashikoibumi Jun 25, 2024
8bfcc4c
add comments
kashikoibumi Jun 25, 2024
da58e00
Merge branch 'v0.6' into py3
kashikoibumi Jun 30, 2024
b978a24
Merge branch 'py3' into py3qt
kashikoibumi Jun 30, 2024
c194943
Merge branch 'v0.6' into py3
kashikoibumi Aug 2, 2024
74a453b
Merge branch 'py3' into py3qt
kashikoibumi Aug 2, 2024
37bbe44
fix bug in generating deterministic address
kashikoibumi Aug 2, 2024
bb6dd07
Merge branch 'py3' into py3qt
kashikoibumi Aug 2, 2024
54cf229
Merge branch 'v0.6' into py3
kashikoibumi Sep 1, 2024
3fe7c2f
Merge branch 'py3' into py3qt
kashikoibumi Sep 1, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions buildscripts/winbuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ function install_python(){
wine python -m pip install pytools==2020.2
echo "Upgrading pip"
wine python -m pip install --upgrade pip
# install pypiwin32 for win32com
wine python -m pip install pypiwin32
}

function install_pyqt(){
Expand All @@ -82,6 +84,8 @@ function install_pyqt(){
echo "Installing PyQt-${PYQT_VERSION} 32b"
wine PyQt${PYQT_VERSION}-x32.exe /S /WX
fi
# and qtpy
wine python -m pip install qtpy
}

function install_openssl(){
Expand Down
3 changes: 1 addition & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,8 +216,7 @@
'pkg_resources',
'pycanberra',
'pyopencl',
'PyQt4',
'PyQt5',
'qtpy',
'qrcode',
'stem',
'xdg',
Expand Down
2 changes: 2 additions & 0 deletions packages/AppImage/PyBitmessage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,13 @@ ingredients:
- python-msgpack
- python-qrcode
- python-qt4
- python-qtpy
- python-setuptools
- python-sip
- python-six
- python-xdg
- sni-qt
- xkb-data
exclude:
- libdb5.3
- libglib2.0-0
Expand Down
2 changes: 1 addition & 1 deletion packages/collectd/pybitmessagestatus.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import collectd
import json
import xmlrpclib
from six.moves import xmlrpc_client as xmlrpclib

pybmurl = ""
api = ""
Expand Down
17 changes: 12 additions & 5 deletions packages/pyinstaller/bitmessagemain.spec
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,16 @@ a = Analysis(
'setuptools.msvc', '_cffi_backend',
'plugins.menu_qrcode', 'plugins.proxyconfig_stem'
],
runtime_hooks=[os.path.join(hookspath, 'pyinstaller_rthook_plugins.py')],
excludes=excludes
# https://github.com/pyinstaller/pyinstaller/wiki/Recipe-PyQt4-API-Version
runtime_hooks = [
os.path.join(hookspath, hook) for hook in (
'pyinstaller_rthook_pyqt4.py',
'pyinstaller_rthook_plugins.py'
)],
excludes += [
'PyQt4.QtOpenGL','PyQt4.QtSql',
'PyQt4.QtSvg', 'PyQt4.QtTest', 'PyQt4.QtWebKit', 'PyQt4.QtXml',
'win32ui']
)


Expand Down Expand Up @@ -90,9 +98,8 @@ a.datas += addTranslations()
a.datas += [('default.ini', os.path.join(srcPath, 'default.ini'), 'DATA')]

excluded_binaries = [
'QtOpenGL4.dll',
'QtSvg4.dll',
'QtXml4.dll',
'QtOpenGL4.dll', 'QtSql4.dll', 'QtSvg4.dll', 'QtTest4.dll',
'QtWebKit4.dll', 'QtXml4.dll'
]
a.binaries = TOC([x for x in a.binaries if x[0] not in excluded_binaries])

Expand Down
10 changes: 10 additions & 0 deletions packages/pyinstaller/hooks/pyinstaller_rthook_pyqt4.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# https://github.com/pyinstaller/pyinstaller/wiki/Recipe-PyQt4-API-Version
import sip

sip.setapi(u'QDate', 2)
sip.setapi(u'QDateTime', 2)
sip.setapi(u'QString', 2)
sip.setapi(u'QTextStream', 2)
sip.setapi(u'QTime', 2)
sip.setapi(u'QUrl', 2)
sip.setapi(u'QVariant', 2)
3 changes: 3 additions & 0 deletions py3start.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh

python3 pybitmessage/bitmessagemain.py "$@"
3 changes: 3 additions & 0 deletions revert_blob_to_text.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh

python3 pybitmessage/revert_blob_to_text.py "$@"
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import platform
import shutil
import sys
import six

from importlib import import_module
from setuptools import setup, Extension
Expand Down Expand Up @@ -83,7 +84,7 @@ def run(self):
'images/kivy/text_images*.png'
]}

if sys.version_info[0] == 3:
if six.PY3:
packages.extend(
[
'pybitmessage.bitmessagekivy',
Expand Down
24 changes: 12 additions & 12 deletions src/addresses.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ def decodeAddress(address):
integer = decodeBase58(address)
if integer == 0:
status = 'invalidcharacters'
return status, 0, 0, ''
return status, 0, 0, b''
# after converting to hex, the string will be prepended
# with a 0x and appended with a L in python2
hexdata = hex(integer)[2:].rstrip('L')
Expand All @@ -200,31 +200,31 @@ def decodeAddress(address):

if checksum != double_sha512(data[:-4])[0:4]:
status = 'checksumfailed'
return status, 0, 0, ''
return status, 0, 0, b''

try:
addressVersionNumber, bytesUsedByVersionNumber = decodeVarint(data[:9])
except varintDecodeError as e:
logger.error(str(e))
status = 'varintmalformed'
return status, 0, 0, ''
return status, 0, 0, b''

if addressVersionNumber > 4:
logger.error('cannot decode address version numbers this high')
status = 'versiontoohigh'
return status, 0, 0, ''
return status, 0, 0, b''
elif addressVersionNumber == 0:
logger.error('cannot decode address version numbers of zero.')
status = 'versiontoohigh'
return status, 0, 0, ''
return status, 0, 0, b''

try:
streamNumber, bytesUsedByStreamNumber = \
decodeVarint(data[bytesUsedByVersionNumber:])
except varintDecodeError as e:
logger.error(str(e))
status = 'varintmalformed'
return status, 0, 0, ''
return status, 0, 0, b''

status = 'success'
if addressVersionNumber == 1:
Expand All @@ -242,21 +242,21 @@ def decodeAddress(address):
return status, addressVersionNumber, streamNumber, \
b'\x00\x00' + embeddedRipeData
elif len(embeddedRipeData) < 18:
return 'ripetooshort', 0, 0, ''
return 'ripetooshort', 0, 0, b''
elif len(embeddedRipeData) > 20:
return 'ripetoolong', 0, 0, ''
return 'otherproblem', 0, 0, ''
return 'ripetoolong', 0, 0, b''
return 'otherproblem', 0, 0, b''
elif addressVersionNumber == 4:
embeddedRipeData = \
data[bytesUsedByVersionNumber + bytesUsedByStreamNumber:-4]
if embeddedRipeData[0:1] == b'\x00':
# In order to enforce address non-malleability, encoded
# RIPE data must have NULL bytes removed from the front
return 'encodingproblem', 0, 0, ''
return 'encodingproblem', 0, 0, b''
elif len(embeddedRipeData) > 20:
return 'ripetoolong', 0, 0, ''
return 'ripetoolong', 0, 0, b''
elif len(embeddedRipeData) < 4:
return 'ripetooshort', 0, 0, ''
return 'ripetooshort', 0, 0, b''
x00string = b'\x00' * (20 - len(embeddedRipeData))
return status, addressVersionNumber, streamNumber, \
x00string + embeddedRipeData
Expand Down
Loading
Loading