- PEP8 changes and PyCharm suggestions

This commit is contained in:
Marius Stanciu
2020-11-12 20:47:43 +02:00
committed by Marius Stanciu
parent 9abe11ff42
commit dea7ce3028
63 changed files with 527 additions and 659 deletions

View File

@@ -1,5 +1,5 @@
from PyQt5 import QtWidgets, QtGui
from PyQt5.QtCore import QSettings, Qt
from PyQt5 import QtWidgets
from PyQt5.QtCore import QSettings
from appGUI.GUIElements import FCComboBox, FCSpinner, FCColorEntry, FCLabel, FCDoubleSpinner, RadioSet
from appGUI.preferences.OptionsGroupUI import OptionsGroupUI
@@ -32,7 +32,7 @@ class CNCJobAdvOptPrefGroupUI(OptionsGroupUI):
self.layout.addLayout(grid0)
# ## Export G-Code
self.export_gcode_label = QtWidgets.QLabel("<b>%s:</b>" % _("Parameters"))
self.export_gcode_label = FCLabel("<b>%s:</b>" % _("Parameters"))
self.export_gcode_label.setToolTip(
_("Export and save G-Code to\n"
"make this object to a file.")
@@ -40,7 +40,7 @@ class CNCJobAdvOptPrefGroupUI(OptionsGroupUI):
grid0.addWidget(self.export_gcode_label, 0, 0, 1, 2)
# Annotation Font Size
self.annotation_fontsize_label = QtWidgets.QLabel('%s:' % _("Annotation Size"))
self.annotation_fontsize_label = FCLabel('%s:' % _("Annotation Size"))
self.annotation_fontsize_label.setToolTip(
_("The font size of the annotation text. In pixels.")
)
@@ -51,7 +51,7 @@ class CNCJobAdvOptPrefGroupUI(OptionsGroupUI):
grid0.addWidget(self.annotation_fontsize_sp, 2, 1)
# Annotation Font Color
self.annotation_color_label = QtWidgets.QLabel('%s:' % _('Annotation Color'))
self.annotation_color_label = FCLabel('%s:' % _('Annotation Color'))
self.annotation_color_label.setToolTip(
_("Set the font color for the annotation texts.")
)
@@ -61,7 +61,7 @@ class CNCJobAdvOptPrefGroupUI(OptionsGroupUI):
grid0.addWidget(self.annotation_fontcolor_entry, 4, 1)
# ## Autolevelling
self.autolevelling_gcode_label = QtWidgets.QLabel("<b>%s</b>" % _("Autolevelling"))
self.autolevelling_gcode_label = FCLabel("<b>%s</b>" % _("Autolevelling"))
self.autolevelling_gcode_label.setToolTip(
_("Parameters for the autolevelling.")
)
@@ -98,7 +98,7 @@ class CNCJobAdvOptPrefGroupUI(OptionsGroupUI):
# ## Columns
self.al_columns_entry = FCSpinner()
self.al_columns_label = QtWidgets.QLabel('%s:' % _("Columns"))
self.al_columns_label = FCLabel('%s:' % _("Columns"))
self.al_columns_label.setToolTip(
_("The number of grid columns.")
)
@@ -108,7 +108,7 @@ class CNCJobAdvOptPrefGroupUI(OptionsGroupUI):
# ## Rows
self.al_rows_entry = FCSpinner()
self.al_rows_label = QtWidgets.QLabel('%s:' % _("Rows"))
self.al_rows_label = FCLabel('%s:' % _("Rows"))
self.al_rows_label.setToolTip(
_("The number of grid rows.")
)
@@ -116,7 +116,7 @@ class CNCJobAdvOptPrefGroupUI(OptionsGroupUI):
grid0.addWidget(self.al_rows_entry, 12, 1)
# Travel Z Probe
self.ptravelz_label = QtWidgets.QLabel('%s:' % _("Probe Z travel"))
self.ptravelz_label = FCLabel('%s:' % _("Probe Z travel"))
self.ptravelz_label.setToolTip(
_("The safe Z for probe travelling between probe points.")
)
@@ -128,7 +128,7 @@ class CNCJobAdvOptPrefGroupUI(OptionsGroupUI):
grid0.addWidget(self.ptravelz_entry, 14, 1)
# Probe depth
self.pdepth_label = QtWidgets.QLabel('%s:' % _("Probe Z depth"))
self.pdepth_label = FCLabel('%s:' % _("Probe Z depth"))
self.pdepth_label.setToolTip(
_("The maximum depth that the probe is allowed\n"
"to probe. Negative value, in current units.")
@@ -141,7 +141,7 @@ class CNCJobAdvOptPrefGroupUI(OptionsGroupUI):
grid0.addWidget(self.pdepth_entry, 16, 1)
# Probe feedrate
self.feedrate_probe_label = QtWidgets.QLabel('%s:' % _("Probe Feedrate"))
self.feedrate_probe_label = FCLabel('%s:' % _("Probe Feedrate"))
self.feedrate_probe_label.setToolTip(
_("The feedrate used while the probe is probing.")
)

View File

@@ -1,7 +1,7 @@
from PyQt5 import QtWidgets, QtGui
from PyQt5 import QtGui
from PyQt5.QtCore import QSettings
from appGUI.GUIElements import FCTextArea
from appGUI.GUIElements import FCTextArea, FCLabel
from appGUI.preferences.OptionsGroupUI import OptionsGroupUI
import gettext
@@ -28,7 +28,7 @@ class CNCJobEditorPrefGroupUI(OptionsGroupUI):
self.decimals = decimals
# Editor Parameters
self.param_label = QtWidgets.QLabel("<b>%s:</b>" % _("Parameters"))
self.param_label = FCLabel("<b>%s:</b>" % _("Parameters"))
self.param_label.setToolTip(
_("A list of Editor parameters.")
)
@@ -43,7 +43,7 @@ class CNCJobEditorPrefGroupUI(OptionsGroupUI):
font.setPointSize(tb_fsize)
# Prepend to G-Code
prependlabel = QtWidgets.QLabel('%s:' % _('Prepend to G-Code'))
prependlabel = FCLabel('%s:' % _('Prepend to G-Code'))
prependlabel.setToolTip(
_("Type here any G-Code commands you would\n"
"like to add at the beginning of the G-Code file.")
@@ -59,7 +59,7 @@ class CNCJobEditorPrefGroupUI(OptionsGroupUI):
self.prepend_text.setFont(font)
# Append text to G-Code
appendlabel = QtWidgets.QLabel('%s:' % _('Append to G-Code'))
appendlabel = FCLabel('%s:' % _('Append to G-Code'))
appendlabel.setToolTip(
_("Type here any G-Code commands you would\n"
"like to append to the generated file.\n"

View File

@@ -1,7 +1,8 @@
from PyQt5 import QtWidgets, QtCore, QtGui
from PyQt5 import QtWidgets
from PyQt5.QtCore import QSettings
from appGUI.GUIElements import FCCheckBox, RadioSet, FCSpinner, FCDoubleSpinner, FCSliderWithSpinner, FCColorEntry
from appGUI.GUIElements import FCCheckBox, RadioSet, FCSpinner, FCDoubleSpinner, FCSliderWithSpinner, FCColorEntry, \
FCLabel
from appGUI.preferences.OptionsGroupUI import OptionsGroupUI
import gettext
import appTranslation as fcTranslate
@@ -27,7 +28,7 @@ class CNCJobGenPrefGroupUI(OptionsGroupUI):
self.decimals = decimals
# ## Plot options
self.plot_options_label = QtWidgets.QLabel("<b>%s:</b>" % _("Plot Options"))
self.plot_options_label = FCLabel("<b>%s:</b>" % _("Plot Options"))
self.layout.addWidget(self.plot_options_label)
grid0 = QtWidgets.QGridLayout()
@@ -44,7 +45,7 @@ class CNCJobGenPrefGroupUI(OptionsGroupUI):
# ###################################################################
# Number of circle steps for circular aperture linear approximation #
# ###################################################################
self.steps_per_circle_label = QtWidgets.QLabel('%s:' % _("Circle Steps"))
self.steps_per_circle_label = FCLabel('%s:' % _("Circle Steps"))
self.steps_per_circle_label.setToolTip(
_("The number of circle steps for <b>GCode</b> \n"
"circle and arc shapes linear approximation.")
@@ -55,7 +56,7 @@ class CNCJobGenPrefGroupUI(OptionsGroupUI):
grid0.addWidget(self.steps_per_circle_entry, 3, 1)
# Tool dia for plot
tdlabel = QtWidgets.QLabel('%s:' % _('Travel dia'))
tdlabel = FCLabel('%s:' % _('Travel dia'))
tdlabel.setToolTip(
_("The width of the travel lines to be\n"
"rendered in the plot.")
@@ -70,10 +71,10 @@ class CNCJobGenPrefGroupUI(OptionsGroupUI):
grid0.addWidget(self.tooldia_entry, 4, 1)
# add a space
grid0.addWidget(QtWidgets.QLabel('<b>%s:</b>' % _("G-code Decimals")), 5, 0, 1, 2)
grid0.addWidget(FCLabel('<b>%s:</b>' % _("G-code Decimals")), 5, 0, 1, 2)
# Number of decimals to use in GCODE coordinates
cdeclabel = QtWidgets.QLabel('%s:' % _('Coordinates'))
cdeclabel = FCLabel('%s:' % _('Coordinates'))
cdeclabel.setToolTip(
_("The number of decimals to be used for \n"
"the X, Y, Z coordinates in CNC code (GCODE, etc.)")
@@ -86,7 +87,7 @@ class CNCJobGenPrefGroupUI(OptionsGroupUI):
grid0.addWidget(self.coords_dec_entry, 6, 1)
# Number of decimals to use in GCODE feedrate
frdeclabel = QtWidgets.QLabel('%s:' % _('Feedrate'))
frdeclabel = FCLabel('%s:' % _('Feedrate'))
frdeclabel.setToolTip(
_("The number of decimals to be used for \n"
"the Feedrate parameter in CNC code (GCODE, etc.)")
@@ -99,7 +100,7 @@ class CNCJobGenPrefGroupUI(OptionsGroupUI):
grid0.addWidget(self.fr_dec_entry, 7, 1)
# The type of coordinates used in the Gcode: Absolute or Incremental
coords_type_label = QtWidgets.QLabel('%s:' % _('Coordinates type'))
coords_type_label = FCLabel('%s:' % _('Coordinates type'))
coords_type_label.setToolTip(
_("The type of coordinates to be used in Gcode.\n"
"Can be:\n"
@@ -132,11 +133,11 @@ class CNCJobGenPrefGroupUI(OptionsGroupUI):
grid0.addWidget(separator_line, 12, 0, 1, 2)
# Travel Line Color
self.travel_color_label = QtWidgets.QLabel('<b>%s</b>' % _('Travel Line Color'))
self.travel_color_label = FCLabel('<b>%s</b>' % _('Travel Line Color'))
grid0.addWidget(self.travel_color_label, 13, 0, 1, 2)
# Plot Line Color
self.tline_color_label = QtWidgets.QLabel('%s:' % _('Outline'))
self.tline_color_label = FCLabel('%s:' % _('Outline'))
self.tline_color_label.setToolTip(
_("Set the travel line color for plotted objects.")
)
@@ -146,7 +147,7 @@ class CNCJobGenPrefGroupUI(OptionsGroupUI):
grid0.addWidget(self.tline_color_entry, 14, 1)
# Plot Fill Color
self.tfill_color_label = QtWidgets.QLabel('%s:' % _('Fill'))
self.tfill_color_label = FCLabel('%s:' % _('Fill'))
self.tfill_color_label.setToolTip(
_("Set the fill color for plotted objects.\n"
"First 6 digits are the color and the last 2\n"
@@ -158,7 +159,7 @@ class CNCJobGenPrefGroupUI(OptionsGroupUI):
grid0.addWidget(self.tfill_color_entry, 15, 1)
# Plot Fill Transparency Level
self.cncjob_alpha_label = QtWidgets.QLabel('%s:' % _('Alpha'))
self.cncjob_alpha_label = FCLabel('%s:' % _('Alpha'))
self.cncjob_alpha_label.setToolTip(
_("Set the fill transparency for plotted objects.")
)
@@ -173,11 +174,11 @@ class CNCJobGenPrefGroupUI(OptionsGroupUI):
grid0.addWidget(separator_line, 17, 0, 1, 2)
# CNCJob Object Color
self.cnc_color_label = QtWidgets.QLabel('<b>%s</b>' % _('Object Color'))
self.cnc_color_label = FCLabel('<b>%s</b>' % _('Object Color'))
grid0.addWidget(self.cnc_color_label, 18, 0, 1, 2)
# Plot Line Color
self.line_color_label = QtWidgets.QLabel('%s:' % _('Outline'))
self.line_color_label = FCLabel('%s:' % _('Outline'))
self.line_color_label.setToolTip(
_("Set the color for plotted objects.")
)
@@ -187,7 +188,7 @@ class CNCJobGenPrefGroupUI(OptionsGroupUI):
grid0.addWidget(self.line_color_entry, 19, 1)
# Plot Fill Color
self.fill_color_label = QtWidgets.QLabel('%s:' % _('Fill'))
self.fill_color_label = FCLabel('%s:' % _('Fill'))
self.fill_color_label.setToolTip(
_("Set the fill color for plotted objects.\n"
"First 6 digits are the color and the last 2\n"

View File

@@ -1,7 +1,7 @@
from PyQt5 import QtWidgets, QtGui
from PyQt5.QtCore import QSettings
from appGUI.GUIElements import RadioSet, FCCheckBox
from appGUI.GUIElements import RadioSet, FCCheckBox, FCLabel
from appGUI.preferences.OptionsGroupUI import OptionsGroupUI
import gettext
@@ -28,7 +28,7 @@ class CNCJobOptPrefGroupUI(OptionsGroupUI):
self.decimals = decimals
# ## Export G-Code
self.export_gcode_label = QtWidgets.QLabel("<b>%s:</b>" % _("Export G-Code"))
self.export_gcode_label = FCLabel("<b>%s:</b>" % _("Export G-Code"))
self.export_gcode_label.setToolTip(
_("Export and save G-Code to\n"
"make this object to a file.")
@@ -49,7 +49,7 @@ class CNCJobOptPrefGroupUI(OptionsGroupUI):
grid0.setColumnStretch(1, 1)
# Plot Kind
self.cncplot_method_label = QtWidgets.QLabel('%s:' % _("Plot kind"))
self.cncplot_method_label = FCLabel('%s:' % _("Plot kind"))
self.cncplot_method_label.setToolTip(
_("This selects the kind of geometries on the canvas to plot.\n"
"Those can be either of type 'Travel' which means the moves\n"
@@ -65,7 +65,7 @@ class CNCJobOptPrefGroupUI(OptionsGroupUI):
grid0.addWidget(self.cncplot_method_label, 1, 0)
grid0.addWidget(self.cncplot_method_radio, 1, 1)
grid0.addWidget(QtWidgets.QLabel(''), 1, 2)
grid0.addWidget(FCLabel(''), 1, 2)
# Display Annotation
self.annotation_cb = FCCheckBox(_("Display Annotation"))