diff --git a/pym/calculate/lib/cl_template.py b/pym/calculate/lib/cl_template.py index b73291c..925f7f7 100644 --- a/pym/calculate/lib/cl_template.py +++ b/pym/calculate/lib/cl_template.py @@ -6050,8 +6050,6 @@ gettext -d cl_template "$*" importlib.import_module( "calculate.%s.variables" % self.objVar.defaultModule) except (ImportError, AttributeError) as e: - #DEBUG - # print(e) return [] if not optFile: diff --git a/pym/calculate/lib/utils/colortext/converter.py b/pym/calculate/lib/utils/colortext/converter.py index ef5d4a8..4a0c2df 100644 --- a/pym/calculate/lib/utils/colortext/converter.py +++ b/pym/calculate/lib/utils/colortext/converter.py @@ -95,9 +95,7 @@ class ConsoleCodesConverter(BaseConverter): self.end = end def tryParse(self, code): - try: - code = ord(code) - except Exception as e: + if not isinstance(code, int): return False return self.begin <= code <= self.end @@ -177,7 +175,6 @@ class ConsoleCodesConverter(BaseConverter): if m: codes = SaveableIterator(ctrl.split(';')) for code in codes: - code = int(code or '0') res = self.evaluteGram(code, codes) if res: @@ -190,7 +187,7 @@ class ConsoleCodesConverter(BaseConverter): yield self.output.outputText(txt) yield self.output.endText() - return "".join((x for x in generator() if x)) + return "".join(x for x in generator() if x) def detect(self, s): """ diff --git a/pym/calculate/lib/utils/colortext/output.py b/pym/calculate/lib/utils/colortext/output.py index ef7ec55..16ee7b4 100644 --- a/pym/calculate/lib/utils/colortext/output.py +++ b/pym/calculate/lib/utils/colortext/output.py @@ -163,6 +163,7 @@ class SaveAttrOutput(BaseOutput): def clone(self): obj = self.__class__() obj.current_state = self.current_state.clone() + #TODO: not sure if list here will result in double list obj.state_stack = list(self.state_stack) return obj @@ -560,10 +561,8 @@ class XmlOutput(SaveAttrOutput): tail = ET.SubElement(tail, Tags.UNDERLINE) if curstate.bold: tail = ET.SubElement(tail, Tags.BOLD) - #TODO debug here text = re.sub('[^\u0020-\uD7FF\u0009\u000A\u000D\uE000-\uFFFD\U00010000-\U0010FFFF]+', '', text) tail.text = text - # return root[0] return root def xmlToString(self, xml):