diff options
author | Ghostkeeper <rubend@tutanota.com> | 2016-10-28 10:55:19 +0300 |
---|---|---|
committer | Ghostkeeper <rubend@tutanota.com> | 2016-10-28 10:55:19 +0300 |
commit | 36fa4afc6c7e015700cc124829219200c989ad81 (patch) | |
tree | edacb8f87d41012bb16924270ab9036cef528b45 /cura | |
parent | 717248bd78317ed0e9132d0fbf730cfac455b8fc (diff) |
Remove misguided attempt at representing UTF-8 encode length
It was commented out anyway. I also updated the documentation there.
Contributes to issue CURA-2692.
Diffstat (limited to 'cura')
-rw-r--r-- | cura/Settings/MachineNameValidator.py | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/cura/Settings/MachineNameValidator.py b/cura/Settings/MachineNameValidator.py index 1ab063600a..d859e85343 100644 --- a/cura/Settings/MachineNameValidator.py +++ b/cura/Settings/MachineNameValidator.py @@ -23,19 +23,11 @@ class MachineNameValidator(QObject): except AttributeError: #Doesn't support statvfs. Probably because it's not a Unix system. filename_max_length = 255 #Assume it's Windows on NTFS. machine_name_max_length = filename_max_length - len("_current_settings.") - len(UM.Settings.ContainerRegistry.getMimeTypeForContainer(UM.Settings.InstanceContainer).preferredSuffix) - # Characters that urllib.parse.quote_plus escapes count for 3! So now we - # must devise a regex that allows only 3 normal characters or 1 special - # character, and that up to [machine_name_max_length / 3] times. + # Characters that urllib.parse.quote_plus escapes count for 12! So now + # we must devise a regex that allows only 12 normal characters or 1 + # special character, and that up to [machine_name_max_length / 12] times. maximum_special_characters = int(machine_name_max_length / 12) unescaped = r"[a-zA-Z0-9_\-\.\/]" - #single_length = r"[\u0000-\u007F]" - #double_length = r"[\u0080-\u07FF]" - #triple_length = r"[\u0800-\uFFFF]" - #quadruple_length = r"[\u10000-\u10FFFF]" - #self.machine_name_regex = r"((((" + unescaped + r"{0,3}|" + single_length + r"){0,2}" \ - # + r"|" + double_length + r"){0,2}" \ - # + r"|" + triple_length + r"){0,2}" \ - # + r"|" + quadruple_length + r"){0," + str(maximum_special_characters) + r"}" self.machine_name_regex = r"((" + unescaped + "){0,12}|.){0," + str(maximum_special_characters) + r"}" validationChanged = pyqtSignal() |