Merge branch '3.5' of github.com:Ultimaker/Cura

This commit is contained in:
Jaime van Kessel 2018-10-08 17:03:25 +02:00
commit d98eafe041
2 changed files with 8 additions and 4 deletions

View file

@ -41,11 +41,15 @@ class StartJobResult(IntEnum):
## Formatter class that handles token expansion in start/end gcode ## Formatter class that handles token expansion in start/end gcode
class GcodeStartEndFormatter(Formatter): class GcodeStartEndFormatter(Formatter):
def get_value(self, key: str, args: str, kwargs: dict, default_extruder_nr: str = "-1") -> str: #type: ignore # [CodeStyle: get_value is an overridden function from the Formatter class] def __init__(self, default_extruder_nr: int = -1) -> None:
super().__init__()
self._default_extruder_nr = default_extruder_nr
def get_value(self, key: str, args: str, kwargs: dict) -> str: #type: ignore # [CodeStyle: get_value is an overridden function from the Formatter class]
# The kwargs dictionary contains a dictionary for each stack (with a string of the extruder_nr as their key), # The kwargs dictionary contains a dictionary for each stack (with a string of the extruder_nr as their key),
# and a default_extruder_nr to use when no extruder_nr is specified # and a default_extruder_nr to use when no extruder_nr is specified
extruder_nr = int(default_extruder_nr) extruder_nr = self._default_extruder_nr
key_fragments = [fragment.strip() for fragment in key.split(",")] key_fragments = [fragment.strip() for fragment in key.split(",")]
if len(key_fragments) == 2: if len(key_fragments) == 2:
@ -339,7 +343,7 @@ class StartSliceJob(Job):
try: try:
# any setting can be used as a token # any setting can be used as a token
fmt = GcodeStartEndFormatter() fmt = GcodeStartEndFormatter(default_extruder_nr = default_extruder_nr)
settings = self._all_extruders_settings.copy() settings = self._all_extruders_settings.copy()
settings["default_extruder_nr"] = default_extruder_nr settings["default_extruder_nr"] = default_extruder_nr
return str(fmt.format(value, **settings)) return str(fmt.format(value, **settings))

View file

@ -171,7 +171,7 @@ UM.PreferencesPage
append({ text: "日本語", code: "ja_JP" }) append({ text: "日本語", code: "ja_JP" })
append({ text: "한국어", code: "ko_KR" }) append({ text: "한국어", code: "ko_KR" })
append({ text: "Nederlands", code: "nl_NL" }) append({ text: "Nederlands", code: "nl_NL" })
//Polish is disabled for being incomplete: append({ text: "Polski", code: "pl_PL" }) append({ text: "Polski", code: "pl_PL" })
append({ text: "Português do Brasil", code: "pt_BR" }) append({ text: "Português do Brasil", code: "pt_BR" })
append({ text: "Português", code: "pt_PT" }) append({ text: "Português", code: "pt_PT" })
append({ text: "Русский", code: "ru_RU" }) append({ text: "Русский", code: "ru_RU" })