mirror of
https://github.com/bringout/oca-ocb-core.git
synced 2026-04-20 05:52:02 +02:00
17.0 vanilla
This commit is contained in:
parent
2e65bf056a
commit
df627a6bba
328 changed files with 578149 additions and 759311 deletions
|
|
@ -22,7 +22,8 @@ def add_stripped_items_before(node, spec, extract):
|
|||
parent = node.getparent()
|
||||
result = parent.text and RSTRIP_REGEXP.search(parent.text)
|
||||
before_text = result.group(0) if result else ''
|
||||
parent.text = (parent.text or '').rstrip() + text
|
||||
fallback_text = None if spec.text is None else ''
|
||||
parent.text = ((parent.text or '').rstrip() + text) or fallback_text
|
||||
else:
|
||||
result = prev.tail and RSTRIP_REGEXP.search(prev.tail)
|
||||
before_text = result.group(0) if result else ''
|
||||
|
|
@ -89,13 +90,7 @@ def locate_node(arch, spec):
|
|||
return None
|
||||
|
||||
for node in arch.iter(spec.tag):
|
||||
if isinstance(node, SKIPPED_ELEMENT_TYPES):
|
||||
continue
|
||||
if all(node.get(attr) == spec.get(attr) for attr in spec.attrib
|
||||
if attr not in ('position', 'version')):
|
||||
# Version spec should match parent's root element's version
|
||||
if spec.get('version') and spec.get('version') != arch.get('version'):
|
||||
return None
|
||||
if all(node.get(attr) == spec.get(attr) for attr in spec.attrib if attr != 'position'):
|
||||
return node
|
||||
return None
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue