Skip to content

Move to Python 3 #21

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

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@

### Install dependencies
1. Clone the repository and checkout the develop branch (default)
1. Install dependencies with `pip install -r requirements.txt` (can be in virtualenv)
1. Install Python 3
1. Install dependencies with `pip3 install -r requirements.txt` (can be in virtualenv)
1. Install `pyqt5-tools` Global or user python installation (not virtualenv)

### Editing the `.ui` files
Expand Down
14 changes: 9 additions & 5 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
pymodbus==1.5.1
PyQt5==5.10.1
pyserial==3.4
sip==4.19.8
six==1.11.0
packaging==20.8
pymodbus==2.4.0
pyparsing==2.4.7
PyQt5==5.15.2
PyQt5-sip==12.8.1
pyserial==3.5
sip==6.0.0
six==1.15.0
toml==0.10.2
4 changes: 2 additions & 2 deletions visualizer/modbus_worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,13 @@ def configure_client(self, settings):
if self.client:
self.client.close() # Properly close the client when re-configuring. Needed for Serial.

if settings["network_type"] is "tcp":
if settings["network_type"] == "tcp":
host = settings["host"]
port = settings["port"]
self.client = ModbusTcpClient(host, port)
self.console_message_available.emit(f"Attempting to connect to {host} on port {port}")

elif settings["network_type"] is "serial":
elif settings["network_type"] == "serial":
port = settings["port"]
protocol = settings["protocol"]
baudrate = settings["baudrate"]
Expand Down
2 changes: 1 addition & 1 deletion visualizer/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def format_write_value(string, dtype='H', byte_order='>', word_order='>'):
num_txt = string[1:]

radix = RADIX_PREFIX.get(num_txt[:2], 10)
if radix is not 10:
if radix != 10:
num_txt = string[2:]

vals = []
Expand Down