kodexa 7.4.415304340442__py3-none-any.whl → 7.4.415470277493__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- kodexa/model/model.py +35 -5
- kodexa/model/objects.py +2 -2
- {kodexa-7.4.415304340442.dist-info → kodexa-7.4.415470277493.dist-info}/METADATA +1 -1
- {kodexa-7.4.415304340442.dist-info → kodexa-7.4.415470277493.dist-info}/RECORD +6 -6
- {kodexa-7.4.415304340442.dist-info → kodexa-7.4.415470277493.dist-info}/LICENSE +0 -0
- {kodexa-7.4.415304340442.dist-info → kodexa-7.4.415470277493.dist-info}/WHEEL +0 -0
kodexa/model/model.py
CHANGED
@@ -1847,10 +1847,10 @@ class ContentNode(object):
|
|
1847
1847
|
bool: True if this node is the first child of its parent or if this node has no parent; else, False;
|
1848
1848
|
|
1849
1849
|
"""
|
1850
|
-
if not self.
|
1850
|
+
if not self.get_parent():
|
1851
1851
|
return True
|
1852
1852
|
|
1853
|
-
return self.index ==
|
1853
|
+
return self.index == self.get_parent().get_first_child_index()
|
1854
1854
|
|
1855
1855
|
def is_last_child(self):
|
1856
1856
|
"""Determines if this node is the last child of its parent or has no parent.
|
@@ -1865,6 +1865,23 @@ class ContentNode(object):
|
|
1865
1865
|
|
1866
1866
|
return self.index == self.get_parent().get_last_child_index()
|
1867
1867
|
|
1868
|
+
def get_first_child_index(self):
|
1869
|
+
"""Returns the min index value for the children of this node. If the node has no children, returns None.
|
1870
|
+
|
1871
|
+
Returns:
|
1872
|
+
int or None: The min index of the children of this node, or None if there are no children.
|
1873
|
+
|
1874
|
+
"""
|
1875
|
+
if not self.get_children():
|
1876
|
+
return None
|
1877
|
+
|
1878
|
+
min_index = None
|
1879
|
+
for child in self.get_children():
|
1880
|
+
if min_index is None or child.index < min_index:
|
1881
|
+
min_index = child.index
|
1882
|
+
|
1883
|
+
return min_index
|
1884
|
+
|
1868
1885
|
def get_last_child_index(self):
|
1869
1886
|
"""Returns the max index value for the children of this node. If the node has no children, returns None.
|
1870
1887
|
|
@@ -1899,6 +1916,7 @@ class ContentNode(object):
|
|
1899
1916
|
|
1900
1917
|
"""
|
1901
1918
|
if self.get_children():
|
1919
|
+
# TODO - is this what we want? Should it return None?
|
1902
1920
|
if index < self.get_children()[0].index:
|
1903
1921
|
virtual_node = self.document.create_node(
|
1904
1922
|
node_type=self.get_children()[0].node_type,
|
@@ -2007,7 +2025,6 @@ class ContentNode(object):
|
|
2007
2025
|
if potential_next_node:
|
2008
2026
|
return potential_next_node
|
2009
2027
|
except Exception:
|
2010
|
-
|
2011
2028
|
# traverse additional layer
|
2012
2029
|
potential_next_node = (
|
2013
2030
|
self.get_parent()
|
@@ -2019,6 +2036,7 @@ class ContentNode(object):
|
|
2019
2036
|
)
|
2020
2037
|
if potential_next_node:
|
2021
2038
|
return potential_next_node
|
2039
|
+
|
2022
2040
|
return node
|
2023
2041
|
|
2024
2042
|
if compiled_node_type_re.match(node.node_type) and (
|
@@ -2052,9 +2070,17 @@ class ContentNode(object):
|
|
2052
2070
|
ContentNode or None: The previous node or None, if no node exists
|
2053
2071
|
|
2054
2072
|
"""
|
2055
|
-
|
2056
2073
|
# TODO: implement/differentiate traverse logic for CHILDREN and SIBLING
|
2057
|
-
|
2074
|
+
|
2075
|
+
parent = self.get_parent()
|
2076
|
+
parent_first_child_index = 0
|
2077
|
+
|
2078
|
+
if parent:
|
2079
|
+
parent_first_child_index = parent.get_first_child_index()
|
2080
|
+
|
2081
|
+
# TODO - the first item in the list does not always have an index property of 0
|
2082
|
+
# TODO - should this be in the loop?
|
2083
|
+
if self.index == parent_first_child_index:
|
2058
2084
|
if (
|
2059
2085
|
traverse == traverse.ALL
|
2060
2086
|
or traverse == traverse.PARENT
|
@@ -2071,6 +2097,8 @@ class ContentNode(object):
|
|
2071
2097
|
compiled_node_type_re = re.compile(node_type_re)
|
2072
2098
|
|
2073
2099
|
while True:
|
2100
|
+
# This creates a virtual node if the index is not found
|
2101
|
+
# and the index is not greater than the last child index
|
2074
2102
|
node = self.get_parent().get_node_at_index(search_index)
|
2075
2103
|
|
2076
2104
|
if not node:
|
@@ -2084,6 +2112,8 @@ class ContentNode(object):
|
|
2084
2112
|
|
2085
2113
|
search_index -= 1
|
2086
2114
|
|
2115
|
+
if traverse == traverse.SIBLING and search_index < 0:
|
2116
|
+
return None
|
2087
2117
|
|
2088
2118
|
class ContentFeature(object):
|
2089
2119
|
"""
|
kodexa/model/objects.py
CHANGED
@@ -5999,7 +5999,7 @@ class ProjectTemplate(ExtensionPackProvided):
|
|
5999
5999
|
category: Optional[Category] = Field(
|
6000
6000
|
None, description="The category of project template"
|
6001
6001
|
)
|
6002
|
-
document_statuses: Optional[List[
|
6002
|
+
document_statuses: Optional[List[ProjectDocumentStatus]] = Field(
|
6003
6003
|
None,
|
6004
6004
|
alias="documentStatuses",
|
6005
6005
|
description="The document statuses that will be created with the project template",
|
@@ -6010,7 +6010,7 @@ class ProjectTemplate(ExtensionPackProvided):
|
|
6010
6010
|
description="The attribute statuses that will be created with the project template",
|
6011
6011
|
)
|
6012
6012
|
|
6013
|
-
task_statuses: Optional[List[
|
6013
|
+
task_statuses: Optional[List[ProjectTaskStatus]] = Field(None,
|
6014
6014
|
alias="taskStatuses",
|
6015
6015
|
description="The task statuses that will be created with the project template",
|
6016
6016
|
)
|
@@ -12,8 +12,8 @@ kodexa/model/entities/check_response.py,sha256=eqBHxO6G2OAziL3p9bHGI-oiPkAG82H6C
|
|
12
12
|
kodexa/model/entities/product.py,sha256=StUhTEeLXmc05cj6XnZppQfeJsqCPbX1jdhsysHH--Q,5787
|
13
13
|
kodexa/model/entities/product_group.py,sha256=540fRGyUf34h1BzAN1DiWu6rGgvaj3xDFhZ2k-RvSFY,3617
|
14
14
|
kodexa/model/entities/product_subscription.py,sha256=UcmWR-qgLfdV7VCtJNwzgkanoS8nBSL6ngVuxQUK1M8,3810
|
15
|
-
kodexa/model/model.py,sha256=
|
16
|
-
kodexa/model/objects.py,sha256=
|
15
|
+
kodexa/model/model.py,sha256=o93SDgw8mj28LWbwJB78PF_Oim8qeCTH1a9x_GDc7yg,120895
|
16
|
+
kodexa/model/objects.py,sha256=j-EmVUkpvGjl7YdjI_2NM9ILaQkwYteVy889MBWXkRc,201068
|
17
17
|
kodexa/model/persistence.py,sha256=jUgQ8xwsAFIoZ_bEynxCDEWhUII42eN0e0Mum0dkQPg,72043
|
18
18
|
kodexa/model/utils.py,sha256=YEG3f8YzBil06D0P3_dfx2S9GnHREzyrjnlWwQ7oPlU,3038
|
19
19
|
kodexa/pipeline/__init__.py,sha256=sA7f5D6qkdMrpp2xTIeefnrUBI6xxEEWostvxfX_1Cs,236
|
@@ -45,7 +45,7 @@ kodexa/testing/test_utils.py,sha256=v44p__gE7ia67W7WeHN2HBFCWSCUrCZt7G4xBNCmwf8,
|
|
45
45
|
kodexa/training/__init__.py,sha256=xs2L62YpRkIRfslQwtQZ5Yxjhm7sLzX2TrVX6EuBnZQ,52
|
46
46
|
kodexa/training/train_utils.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
47
47
|
kodexa/utils/__init__.py,sha256=Pnim1o9_db5YEnNvDTxpM7HG-qTlL6n8JwFwOafU9wo,5928
|
48
|
-
kodexa-7.4.
|
49
|
-
kodexa-7.4.
|
50
|
-
kodexa-7.4.
|
51
|
-
kodexa-7.4.
|
48
|
+
kodexa-7.4.415470277493.dist-info/LICENSE,sha256=WNHhf_5RCaeuKWyq_K39vmp9F28LxKsB4SpomwSZ2L0,11357
|
49
|
+
kodexa-7.4.415470277493.dist-info/METADATA,sha256=ieEBDuFnZ124qeiD-NzXEq_esZpcmszhNhu9dddDHhg,2916
|
50
|
+
kodexa-7.4.415470277493.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
|
51
|
+
kodexa-7.4.415470277493.dist-info/RECORD,,
|
File without changes
|
File without changes
|