Commit e9e24e46 authored by Ivan Tyagov's avatar Ivan Tyagov

Always pass destination array reference.

Better end condition.
parent bc825ce5
......@@ -56,6 +56,12 @@
Simply a wrapper to real method.\n
"""\n
data_stream = context.restrictedTraverse(data_stream_relative_url)\n
total_stream_length = data_stream.getSize()\n
\n
if start > total_stream_length:\n
# end reached\n
return\n
\n
data_stream_chunk_list = data_stream.readChunkList(start, end)\n
\n
# do call transformation script\n
......@@ -68,26 +74,26 @@ if transform_script_id is not None:\n
data_array_reference)\n
\n
# [warning] store current position offset in Data Stream, this can cause easily \n
# ConflictErrors and it spawns re-index activities on DataStream\n
data_stream.setOffset(end)\n
# ConflictErrors and it spawns re-index activities on DataStream. Thus \n
# disable for now.\n
#data_stream.setOffset(end)\n
\n
# start another read in another activity\n
start += chunk_length\n
end += chunk_length\n
total_stream_length = data_stream.getSize()\n
\n
if end > total_stream_length:\n
# no read beyond end of stream\n
end = total_stream_length\n
\n
if start < total_stream_length:\n
# some bytes left ...\n
data_stream.activate().DataStream_readChunkListAndTransform( \\\n
# some bytes left ...\n
data_stream.activate().DataStream_readChunkListAndTransform( \\\n
data_stream.getRelativeUrl(), \\\n
start, \\\n
end, \\\n
chunk_length, \\\n
transform_script_id)\n
transform_script_id,\n
data_array_reference)\n
]]></string> </value>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment