From 8b6eb61b14b9f0c482d43b2b8b4db5c3cc798b92 Mon Sep 17 00:00:00 2001 From: Juan Jose Scarafia Date: Sun, 24 Jun 2018 08:56:45 -0300 Subject: [PATCH 1/5] [FIX] urllib.unquote --- aeroolib/plugins/opendocument.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/aeroolib/plugins/opendocument.py b/aeroolib/plugins/opendocument.py index ed89143..94c81d9 100644 --- a/aeroolib/plugins/opendocument.py +++ b/aeroolib/plugins/opendocument.py @@ -349,8 +349,8 @@ def check_except_directive( expr): else: expr = check_except_directive(expr) and "__filter(%s)" % statement.attrib["{%s}description" % self.namespaces['text']][1:-1] or expr elif statement.tag == text_a: - expr = urllib.unquote(statement.attrib[xlink_href_attrib][9:]) - expr = check_except_directive(expr) and "__filter(%s)" % urllib.unquote(statement.attrib[xlink_href_attrib][9:]) or expr + expr = urllib.parse.unquote(statement.attrib[xlink_href_attrib][9:]) + expr = check_except_directive(expr) and "__filter(%s)" % urllib.parse.unquote(statement.attrib[xlink_href_attrib][9:]) or expr if not expr: raise OOTemplateError("No expression in the tag", @@ -688,7 +688,7 @@ def _handle_hyperlinks(self, tree): href_attrib = '{%s}href' % self.namespaces['xlink'] py_attrs = '{%s}attrs' % self.namespaces['py'] for a in tree.xpath(xpath_href_expr, namespaces=self.namespaces): - a.attrib[py_attrs] = "__aeroo_hyperlink(%s)" % urllib.unquote(a.attrib[href_attrib]).replace('python://','').replace('pythonuri://','')#[9:] + a.attrib[py_attrs] = "__aeroo_hyperlink(%s)" % urllib.parse.unquote(a.attrib[href_attrib]).replace('python://','').replace('pythonuri://','')#[9:] del a.attrib[href_attrib] def _handle_innerdocs(self, tree): From 45ab00c5d67b3bcd46ffbaeadb945ef63c976398 Mon Sep 17 00:00:00 2001 From: Juan Jose Scarafia Date: Fri, 20 Jul 2018 12:18:15 -0300 Subject: [PATCH 2/5] [FIX] genshi version --- setup.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 878e796..8b17dc8 100755 --- a/setup.py +++ b/setup.py @@ -31,8 +31,13 @@ def get_version(): version=get_version(), packages=find_packages(), python_requires='>=3', + # use this genshi version to fix error when, for eg, you send arguments like "date=True" check this https://genshi.edgewall.org/ticket/600 + dependency_links=[ + 'git+https://github.com/edgewall/genshi.git/@stable/0.7.x#egg=genshi-0', + ], install_requires=[ - "Genshi >= 0.5", + # "genshi >= 0.5", + "genshi", "lxml >= 2.0" ], classifiers=[ From fe7a111635c79ec1c01ea7fa178a0cf72eae5af5 Mon Sep 17 00:00:00 2001 From: nicomacr Date: Thu, 26 Jul 2018 10:06:36 -0300 Subject: [PATCH 3/5] [FIX] Python 3 compatibility next() --- aeroolib/plugins/opendocument.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/aeroolib/plugins/opendocument.py b/aeroolib/plugins/opendocument.py index 94c81d9..2720144 100644 --- a/aeroolib/plugins/opendocument.py +++ b/aeroolib/plugins/opendocument.py @@ -499,8 +499,7 @@ def _handle_column_loops(self, statement, ancestor, opening, repeat_tag = '{%s}repeat' % AEROO_URI # table node (it is not necessarily the direct parent of ancestor) - table_node = ancestor.iterancestors('{%s}table' % table_namespace) \ - .next() + table_node = next(ancestor.iterancestors('{%s}table' % table_namespace)) table_name = table_node.attrib['{%s}name' % table_namespace] # add counting instructions @@ -643,7 +642,7 @@ def _handle_row_spanned_column_loops(self, statement, outer_o_node, assert row_node.tag == table_row_tag next_rows = row_node.itersiblings(table_row_tag) for row_idx in range(rows_spanned-1): - next_row_node = next_rows.next() + next_row_node = next(next_rows) rows_to_wrap.append(next_row_node) # compute the start and end nodes first = next_row_node[opening_pos] @@ -1017,7 +1016,7 @@ def check_new_lines(self, tree, namespaces): next_child = new_parent_node try: while(True): - curr_child = parent_children.next() + curr_child = next(parent_children) if curr_child.tag=='{%s}span' % namespaces['text'] and tag.text==curr_child.text: new_span_node = EtreeElement('{%s}span' % namespaces['text'], attrib=tag.attrib, @@ -1047,14 +1046,14 @@ def check_new_lines(self, tree, namespaces): try: next_text = True while(next_text): - next_child = parent_children.next() + next_child = next(parent_children) curr_child.append(next_child) next_text = next_child.text except StopIteration: pass try: while(True): - next_child = parent_children.next() + next_child = next(parent_children) if not next_child.text: curr_child.append(next_child) else: From eb3f232f250ce6da978c41e47fdb95b43b0dad8d Mon Sep 17 00:00:00 2001 From: Juan Jose Scarafia Date: Tue, 18 Dec 2018 15:14:39 -0300 Subject: [PATCH 4/5] [FIX] namespaces.get('calcext') --- aeroolib/plugins/opendocument.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aeroolib/plugins/opendocument.py b/aeroolib/plugins/opendocument.py index 2720144..0d76bd1 100644 --- a/aeroolib/plugins/opendocument.py +++ b/aeroolib/plugins/opendocument.py @@ -1087,7 +1087,7 @@ def check_guess_type(self, tree, namespaces): guess_type = 'float' tag.attrib['{%s}value' % namespaces['office']] = tag[0].text # AKRETION HACK https://github.com/aeroo/aeroolib/issues/7 - tag.attrib['{%s}value-type' % namespaces['calcext']] = guess_type + tag.attrib['{%s}value-type' % namespaces.get('calcext')] = guess_type except (ValueError,TypeError): guess_type = 'string' tag.attrib['{%s}value-type' % namespaces['office']] = guess_type From d5bd0945c2aeb7ccd70e0e578b63f430ef9cc207 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20Zacchino?= Date: Thu, 26 Jun 2025 10:36:54 -0300 Subject: [PATCH 5/5] [FIX] Remove unused import --- aeroolib/reporting.py | 1 - 1 file changed, 1 deletion(-) diff --git a/aeroolib/reporting.py b/aeroolib/reporting.py index ed1ff29..896ca47 100755 --- a/aeroolib/reporting.py +++ b/aeroolib/reporting.py @@ -37,7 +37,6 @@ import os, sys -import pkg_resources from genshi.template import TemplateLoader def _absolute(path):