kodexa 7.0.12260797471__py3-none-any.whl → 7.0.12396563598__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 CHANGED
@@ -293,6 +293,8 @@ class ContentNode(object):
293
293
  if content is not None and len(self.get_content_parts()) == 0:
294
294
  self.set_content_parts([content])
295
295
 
296
+ self.cached_all_content = None
297
+
296
298
  def get_content_parts(self):
297
299
  return self.document.get_persistence().get_content_parts(self)
298
300
 
@@ -818,12 +820,13 @@ class ContentNode(object):
818
820
  self.document.get_persistence().flush_cache()
819
821
  return parsed_selector.resolve(self, variables, context)
820
822
 
821
- def get_all_content(self, separator=" ", strip=True):
823
+ def get_all_content(self, separator=" ", strip=True, use_cache=False):
822
824
  """Get this node's content, concatenated with all of its children's content.
823
825
 
824
826
  Args:
825
827
  separator(str, optional): The separator to use in joining content together; defaults to " ".
826
828
  strip(boolean, optional): Strip the result
829
+ use_cache(boolean, optional): Use the cache
827
830
 
828
831
  Returns:
829
832
  str: The complete content for this node concatenated with the content of all child nodes.
@@ -833,6 +836,9 @@ class ContentNode(object):
833
836
  "This string is made up of multiple nodes"
834
837
  """
835
838
  s = ""
839
+ if self.cached_all_content is not None and use_cache:
840
+ return self.cached_all_content
841
+
836
842
  children = self.get_content_parts()
837
843
  for part in children:
838
844
  if isinstance(part, str):
@@ -855,7 +861,8 @@ class ContentNode(object):
855
861
  s += separator
856
862
  s += child.get_all_content(separator, strip=strip)
857
863
 
858
- return s.strip() if strip else s
864
+ self.cached_all_content = s.strip() if strip else s
865
+ return self.cached_all_content
859
866
 
860
867
  def adopt_children(self, nodes_to_adopt, replace=False):
861
868
  """This will take a list of content nodes and adopt them under this node, ensuring they are re-parented.
@@ -96,6 +96,7 @@ class SqliteDocumentPersistence(object):
96
96
  self.cursor.execute("PRAGMA journal_mode=OFF")
97
97
  self.cursor.execute("pragma temp_store = memory")
98
98
  self.cursor.execute("pragma mmap_size = 30000000000")
99
+ self.cursor.execute("pragma cache_size = 10000") # Set the cache size to 10,000 pages
99
100
 
100
101
  try:
101
102
  # We need to populate node_type_id_by_name
@@ -835,9 +836,10 @@ class SqliteDocumentPersistence(object):
835
836
  self.connection.commit()
836
837
  self.cursor.execute("VACUUM")
837
838
  self.cursor = self.connection.cursor()
838
- self.cursor.execute("PRAGMA journal_mode=OFF")
839
+ self.cursor.execute("pragma journal_mode=OFF")
839
840
  self.cursor.execute("pragma temp_store = memory")
840
841
  self.cursor.execute("pragma mmap_size = 30000000000")
842
+ self.cursor.execute("pragma cache_size = 10000") # Set the cache size to 10,000 pages
841
843
 
842
844
  def dump_in_memory_db_to_file(self):
843
845
  # Connect to a new or existing database file
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: kodexa
3
- Version: 7.0.12260797471
3
+ Version: 7.0.12396563598
4
4
  Summary: Python SDK for the Kodexa Platform
5
5
  Author: Austin Redenbaugh
6
6
  Author-email: austin@kodexa.com
@@ -11,9 +11,9 @@ kodexa/model/entities/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3h
11
11
  kodexa/model/entities/check_response.py,sha256=eqBHxO6G2OAziL3p9bHGI-oiPkAG82H6Choc8wyvtM4,3949
12
12
  kodexa/model/entities/product.py,sha256=ZDpHuBE_9FJ-klnkyBvTfPwYOqBkM1wraZMtHqNA8FQ,3526
13
13
  kodexa/model/entities/product_subscription.py,sha256=UcmWR-qgLfdV7VCtJNwzgkanoS8nBSL6ngVuxQUK1M8,3810
14
- kodexa/model/model.py,sha256=wY5HnpsAnKlH_aDEHWNf-ZrhdrBg-DtqGFszjkdZtPU,118340
14
+ kodexa/model/model.py,sha256=jpGYJbFf2kzaBarGLvd_4q6u6iMtbgjCFIhXwqsTkzY,118615
15
15
  kodexa/model/objects.py,sha256=4Oyjs6omlHfwziAK1m2tFk4jSnzN7lFdXACog07ed1c,185124
16
- kodexa/model/persistence.py,sha256=PTh9jmqYCDuWfiuCssLttFaYWiMA_fCiwjgsYDW4AhE,68281
16
+ kodexa/model/persistence.py,sha256=AVITArEFBnl3UWL0-L7dz_Y35sxaLq0Dys-vFV_kH4k,68471
17
17
  kodexa/model/utils.py,sha256=6R-3rFiW9irBwj0Mq5yhp7EDXkNUFaeFhr3bWmnlW4g,2961
18
18
  kodexa/pipeline/__init__.py,sha256=sA7f5D6qkdMrpp2xTIeefnrUBI6xxEEWostvxfX_1Cs,236
19
19
  kodexa/pipeline/pipeline.py,sha256=ZYpJAWcwV4YRK589DUhU0vXGQlkNSj4J2TsGbYqTLjo,25221
@@ -43,7 +43,7 @@ kodexa/testing/test_utils.py,sha256=DrLCkHxdb6AbZ-X3WmTMbQmnVIm55VEBL8MjtUK9POs,
43
43
  kodexa/training/__init__.py,sha256=xs2L62YpRkIRfslQwtQZ5Yxjhm7sLzX2TrVX6EuBnZQ,52
44
44
  kodexa/training/train_utils.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
45
45
  kodexa/utils/__init__.py,sha256=Pnim1o9_db5YEnNvDTxpM7HG-qTlL6n8JwFwOafU9wo,5928
46
- kodexa-7.0.12260797471.dist-info/LICENSE,sha256=WNHhf_5RCaeuKWyq_K39vmp9F28LxKsB4SpomwSZ2L0,11357
47
- kodexa-7.0.12260797471.dist-info/METADATA,sha256=05A83UZeGYAMX48VXMOh-geCtXObL4lfIEx6QxCIE5s,3527
48
- kodexa-7.0.12260797471.dist-info/WHEEL,sha256=Zb28QaM1gQi8f4VCBhsUklF61CTlNYfs9YAZn-TOGFk,88
49
- kodexa-7.0.12260797471.dist-info/RECORD,,
46
+ kodexa-7.0.12396563598.dist-info/LICENSE,sha256=WNHhf_5RCaeuKWyq_K39vmp9F28LxKsB4SpomwSZ2L0,11357
47
+ kodexa-7.0.12396563598.dist-info/METADATA,sha256=6GaCSj4UK3lNqnlhvSywHfjfg4d5Bf99DuAurg6iE1k,3527
48
+ kodexa-7.0.12396563598.dist-info/WHEEL,sha256=Zb28QaM1gQi8f4VCBhsUklF61CTlNYfs9YAZn-TOGFk,88
49
+ kodexa-7.0.12396563598.dist-info/RECORD,,