Allow urls to be passed to PySerial for RFC2217/hwgrep support

This commit is contained in:
Julian Kent 2015-03-09 13:29:16 +02:00
parent ecbac157a9
commit 74a2716fc9

View File

@ -4,7 +4,7 @@ import threading
from string import printable from string import printable
from PyQt4 import QtCore, QtGui, QtWebKit from PyQt4 import QtCore, QtGui, QtWebKit
from serial import Serial, SerialException from serial import Serial, SerialException, serial_for_url
from colourterm import SettingsDialog, ConnectDialog, SComboBox, Highlight, from_utf8, translate, \ from colourterm import SettingsDialog, ConnectDialog, SComboBox, Highlight, from_utf8, translate, \
create_default_highlights create_default_highlights
@ -293,8 +293,8 @@ class MainWindow(QtGui.QMainWindow, UiMainWindow):
except (TypeError, ValueError): except (TypeError, ValueError):
QtGui.QMessageBox.critical(self, 'Error opening port', 'Error: Port is not valid') QtGui.QMessageBox.critical(self, 'Error opening port', 'Error: Port is not valid')
return return
self.device = Serial( self.device = serial_for_url(
port=port, url=port,
baudrate=self.connect_dialog.get_baud(), baudrate=self.connect_dialog.get_baud(),
bytesize=self.connect_dialog.get_data_bits(), bytesize=self.connect_dialog.get_data_bits(),
parity=self.connect_dialog.get_parity(), parity=self.connect_dialog.get_parity(),
@ -302,7 +302,8 @@ class MainWindow(QtGui.QMainWindow, UiMainWindow):
timeout=1, timeout=1,
xonxoff=self.connect_dialog.get_software_handshake(), xonxoff=self.connect_dialog.get_software_handshake(),
rtscts=self.connect_dialog.get_hardware_handshake(), rtscts=self.connect_dialog.get_hardware_handshake(),
dsrdtr=None dsrdtr=None,
do_not_open=False
) )
self.device_closed = False self.device_closed = False
if not self.device.isOpen(): if not self.device.isOpen():