mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-06 22:47:29 -06:00
Convert some class functions to static
Since they didn't access any class attributes, there is no need for them to be classMethods
This commit is contained in:
parent
94b6f7864f
commit
09025edffa
1 changed files with 9 additions and 9 deletions
|
@ -43,11 +43,11 @@ class XmlMaterialProfile(InstanceContainer):
|
||||||
#
|
#
|
||||||
# \param xml_version: The version number found in an XML file.
|
# \param xml_version: The version number found in an XML file.
|
||||||
# \return The corresponding setting_version.
|
# \return The corresponding setting_version.
|
||||||
@classmethod
|
@staticmethod
|
||||||
def xmlVersionToSettingVersion(cls, xml_version: str) -> int:
|
def xmlVersionToSettingVersion(xml_version: str) -> int:
|
||||||
if xml_version == "1.3":
|
if xml_version == "1.3":
|
||||||
return CuraApplication.SettingVersion
|
return CuraApplication.SettingVersion
|
||||||
return 0 #Older than 1.3.
|
return 0 # Older than 1.3.
|
||||||
|
|
||||||
def getInheritedFiles(self):
|
def getInheritedFiles(self):
|
||||||
return self._inherited_files
|
return self._inherited_files
|
||||||
|
@ -1134,8 +1134,8 @@ class XmlMaterialProfile(InstanceContainer):
|
||||||
builder.data(data)
|
builder.data(data)
|
||||||
builder.end(tag_name)
|
builder.end(tag_name)
|
||||||
|
|
||||||
@classmethod
|
@staticmethod
|
||||||
def _profile_name(cls, material_name, color_name):
|
def _profile_name(material_name, color_name):
|
||||||
if material_name is None:
|
if material_name is None:
|
||||||
return "Unknown Material"
|
return "Unknown Material"
|
||||||
if color_name != "Generic":
|
if color_name != "Generic":
|
||||||
|
@ -1143,8 +1143,8 @@ class XmlMaterialProfile(InstanceContainer):
|
||||||
else:
|
else:
|
||||||
return material_name
|
return material_name
|
||||||
|
|
||||||
@classmethod
|
@staticmethod
|
||||||
def getPossibleDefinitionIDsFromName(cls, name):
|
def getPossibleDefinitionIDsFromName(name):
|
||||||
name_parts = name.lower().split(" ")
|
name_parts = name.lower().split(" ")
|
||||||
merged_name_parts = []
|
merged_name_parts = []
|
||||||
for part in name_parts:
|
for part in name_parts:
|
||||||
|
@ -1182,8 +1182,8 @@ class XmlMaterialProfile(InstanceContainer):
|
||||||
return product_to_id_map
|
return product_to_id_map
|
||||||
|
|
||||||
## Parse the value of the "material compatible" property.
|
## Parse the value of the "material compatible" property.
|
||||||
@classmethod
|
@staticmethod
|
||||||
def _parseCompatibleValue(cls, value: str):
|
def _parseCompatibleValue(value: str):
|
||||||
return value in {"yes", "unknown"}
|
return value in {"yes", "unknown"}
|
||||||
|
|
||||||
## Small string representation for debugging.
|
## Small string representation for debugging.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue