diff options
author | fieldOfView <aldo@fieldofview.com> | 2016-06-05 13:22:23 +0300 |
---|---|---|
committer | fieldOfView <aldo@fieldofview.com> | 2016-06-05 13:22:23 +0300 |
commit | d13b5adda6549064ec9eca0e0f19aa35f73cef79 (patch) | |
tree | eeab1c5e6e52441da074d73d0a0e427320158ff6 /cura/PrintInformation.py | |
parent | eeb1882c2fce21bbf776cd9e3f13df75b3cb79a7 (diff) |
Codestyle & comments
CURA-1619
Diffstat (limited to 'cura/PrintInformation.py')
-rw-r--r-- | cura/PrintInformation.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/cura/PrintInformation.py b/cura/PrintInformation.py index 22bc562502..47d3989b55 100644 --- a/cura/PrintInformation.py +++ b/cura/PrintInformation.py @@ -51,7 +51,7 @@ class PrintInformation(QObject): self._backend.printDurationMessage.connect(self._onPrintDurationMessage) self._job_name = "" - Application.getInstance().globalContainerStackChanged.connect(self._onGlobalStackChanged) + Application.getInstance().globalContainerStackChanged.connect(self._setAbbreviatedMachineName) Application.getInstance().fileLoaded.connect(self.setJobName) currentPrintTimeChanged = pyqtSignal() @@ -99,12 +99,14 @@ class PrintInformation(QObject): else: return base_name - def _onGlobalStackChanged(self): + ## Created an acronymn-like abbreviated machine name from the currently active machine name + # Called each time the global stack is switched + def _setAbbreviatedMachineName(self): global_stack_name = Application.getInstance().getGlobalContainerStack().getName() split_name = global_stack_name.split(" ") abbr_machine = "" for word in split_name: - if(word.lower() == "ultimaker"): + if word.lower() == "ultimaker": abbr_machine += "UM" elif word.isdigit(): abbr_machine += word @@ -113,5 +115,6 @@ class PrintInformation(QObject): self._abbr_machine = abbr_machine + ## Utility method that strips accents from characters (eg: รข -> a) def _stripAccents(self, str): return ''.join(char for char in unicodedata.normalize('NFD', str) if unicodedata.category(char) != 'Mn')
\ No newline at end of file |