mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-24 15:13:56 -06:00
Minor code style fixes
Contributes to issue CURA-5734.
This commit is contained in:
parent
4def636fc9
commit
b37252f124
4 changed files with 10 additions and 8 deletions
|
@ -26,15 +26,15 @@ class SettingVisibilityPreset(QObject):
|
|||
def settings(self) -> List[str]:
|
||||
return self._settings
|
||||
|
||||
@pyqtProperty(str, notify=onIdChanged)
|
||||
@pyqtProperty(str, notify = onIdChanged)
|
||||
def id(self) -> str:
|
||||
return self._id
|
||||
|
||||
@pyqtProperty(int, notify=onWeightChanged)
|
||||
@pyqtProperty(int, notify = onWeightChanged)
|
||||
def weight(self) -> int:
|
||||
return self._weight
|
||||
|
||||
@pyqtProperty(str, notify=onNameChanged)
|
||||
@pyqtProperty(str, notify = onNameChanged)
|
||||
def name(self) -> str:
|
||||
return self._name
|
||||
|
||||
|
@ -66,7 +66,7 @@ class SettingVisibilityPreset(QObject):
|
|||
Logger.log("e", "[%s] is not a file", file_path)
|
||||
return None
|
||||
|
||||
parser = ConfigParser(allow_no_value=True) # Accept options without any value,
|
||||
parser = ConfigParser(allow_no_value = True) # Accept options without any value,
|
||||
|
||||
parser.read([file_path])
|
||||
if not parser.has_option("general", "name") or not parser.has_option("general", "weight"):
|
||||
|
|
|
@ -115,8 +115,10 @@ UM.PreferencesPage
|
|||
|
||||
currentIndex:
|
||||
{
|
||||
for(var i = 0; i < settingVisibilityPresetsModel.items.length; ++i) {
|
||||
if(settingVisibilityPresetsModel.items[i].id == settingVisibilityPresetsModel.activePreset) {
|
||||
for(var i = 0; i < settingVisibilityPresetsModel.items.length; ++i)
|
||||
{
|
||||
if(settingVisibilityPresetsModel.items[i].id == settingVisibilityPresetsModel.activePreset)
|
||||
{
|
||||
currentIndex = i;
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -49,7 +49,7 @@ def test_setActivePreset():
|
|||
preferences = Preferences()
|
||||
visibility_model = SettingVisibilityPresetsModel(preferences)
|
||||
visibility_model.activePresetChanged = MagicMock()
|
||||
# Ensure that we start of with basic (since we didn't change anyting just yet!)
|
||||
# Ensure that we start off with basic (since we didn't change anyting just yet!)
|
||||
assert visibility_model.activePreset == "basic"
|
||||
|
||||
# Everything should be the same.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue