mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-08 23:46:22 -06:00
Some style fixing, and added a test script to test for the major style violations.
This commit is contained in:
parent
4a965e04b4
commit
83c367cdf4
4 changed files with 21 additions and 15 deletions
|
@ -150,7 +150,6 @@ class PrinterConnection(SignalEmitter):
|
|||
self._firmware_file_name = file_name
|
||||
self._update_firmware_thread.start()
|
||||
|
||||
|
||||
## Private connect function run by thread. Can be started by calling connect.
|
||||
def _connect(self):
|
||||
self._is_connecting = True
|
||||
|
@ -378,6 +377,7 @@ class PrinterConnection(SignalEmitter):
|
|||
self.sendCommand("M105 T%d" % self._temperature_requested_extruder_index)
|
||||
else:
|
||||
self.sendCommand("M105")
|
||||
|
||||
## Send next Gcode in the gcode list
|
||||
def _sendNextGcodeLine(self):
|
||||
if self._gcode_position >= len(self._gcode):
|
||||
|
|
|
@ -19,6 +19,7 @@ from UM.i18n import i18nCatalog
|
|||
|
||||
i18n_catalog = i18nCatalog('plugins')
|
||||
|
||||
|
||||
class USBPrinterManager(QObject, SignalEmitter, Extension):
|
||||
def __init__(self, parent = None):
|
||||
super().__init__(parent)
|
||||
|
@ -55,7 +56,6 @@ class USBPrinterManager(QObject, SignalEmitter, Extension):
|
|||
self._control_view.setSource(QUrl("plugins/USBPrinting/ControlWindow.qml"))
|
||||
self._control_view.show()
|
||||
|
||||
|
||||
processingProgress = pyqtSignal(float, arguments = ['amount'])
|
||||
@pyqtProperty(float, notify=processingProgress)
|
||||
def progress(self):
|
||||
|
@ -268,7 +268,7 @@ class USBPrinterManager(QObject, SignalEmitter, Extension):
|
|||
i=0
|
||||
while True:
|
||||
values = winreg.EnumValue(key, i)
|
||||
if not base_list or 'USBSER' in values[0]:
|
||||
if 'USBSER' in values[0]:
|
||||
base_list += [values[1]]
|
||||
i+=1
|
||||
except:
|
||||
|
@ -276,7 +276,7 @@ class USBPrinterManager(QObject, SignalEmitter, Extension):
|
|||
|
||||
if base_list:
|
||||
base_list = base_list + glob.glob('/dev/ttyUSB*') + glob.glob('/dev/ttyACM*') + glob.glob("/dev/cu.usb*")
|
||||
base_list = filter(lambda s: not 'Bluetooth' in s, base_list) #Filter because mac sometimes puts them in the list
|
||||
base_list = filter(lambda s: 'Bluetooth' not in s, base_list) #Filter because mac sometimes puts them in the list
|
||||
#prev = profile.getMachineSetting('serial_port_auto')
|
||||
#if prev in base_list:
|
||||
# base_list.remove(prev)
|
||||
|
|
|
@ -57,8 +57,10 @@ class IspBase():
|
|||
"""
|
||||
raise IspError("Called undefined verifyFlash")
|
||||
|
||||
|
||||
class IspError(BaseException):
|
||||
def __init__(self, value):
|
||||
self.value = value
|
||||
|
||||
def __str__(self):
|
||||
return repr(self.value)
|
||||
|
|
|
@ -3,7 +3,10 @@ STK500v2 protocol implementation for programming AVR chips.
|
|||
The STK500v2 protocol is used by the ArduinoMega2560 and a few other Arduino platforms to load firmware.
|
||||
This is a python 3 conversion of the code created by David Braam for the Cura project.
|
||||
"""
|
||||
import os, struct, sys, time
|
||||
import os
|
||||
import struct
|
||||
import sys
|
||||
import time
|
||||
|
||||
from serial import Serial
|
||||
from serial import SerialException
|
||||
|
@ -11,6 +14,7 @@ from serial import SerialTimeoutException
|
|||
|
||||
from . import ispBase, intelHex
|
||||
|
||||
|
||||
class Stk500v2(ispBase.IspBase):
|
||||
def __init__(self):
|
||||
self.serial = None
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue