Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
W
wendelin
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Yusei Tahara
wendelin
Commits
aeb48a30
Commit
aeb48a30
authored
Mar 01, 2017
by
Klaus Wölfel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
basic support for remote slice and list indexing of data arrays
parent
e816e4d6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
0 deletions
+15
-0
bt5/erp5_wendelin/DocumentTemplateItem/portal_components/document.erp5.DataArray.py
...TemplateItem/portal_components/document.erp5.DataArray.py
+15
-0
No files found.
bt5/erp5_wendelin/DocumentTemplateItem/portal_components/document.erp5.DataArray.py
View file @
aeb48a30
...
...
@@ -147,6 +147,21 @@ class DataArray(BigFile):
RESPONSE
.
setHeader
(
"Content-Type"
,
"application/octet-stream"
)
# HTTP Range header handling: return True if we've served a range
# chunk out of our data.
# convert ranges from bytes to array indices
slice_index
=
REQUEST
.
get
(
'slice_index'
,
None
)
if
slice_index
is
not
None
:
slice_index_list
=
[]
for
index
in
slice_index
:
slice_index_list
.
append
(
slice
(
index
.
get
(
'start'
),
index
.
get
(
'stop'
),
index
.
get
(
'step'
)))
list_index
=
REQUEST
.
get
(
'list_index'
,
None
)
if
list_index
is
not
None
:
RESPONSE
.
write
(
self
.
getArray
()[
tuple
(
slice_index_list
)][
list_index
].
tobytes
())
else
:
RESPONSE
.
write
(
self
.
getArray
()[
tuple
(
slice_index_list
)].
tobytes
())
return
True
range
=
REQUEST
.
get_header
(
'Range'
,
None
)
request_range
=
REQUEST
.
get_header
(
'Request-Range'
,
None
)
if
request_range
is
not
None
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment