Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Vladislav Rykov
THSO.server
Commits
f68cb5c5
Commit
f68cb5c5
authored
Jul 02, 2020
by
Vladislav Rykov
Browse files
admin data download fixed
parent
6ad51f9e
Changes
2
Show whitespace changes
Inline
Side-by-side
app/app/__pycache__/views_admin.cpython-37.pyc
View file @
f68cb5c5
No preview for this file type
app/app/views_admin.py
View file @
f68cb5c5
...
@@ -474,6 +474,7 @@ def administration_user_application_device_download_csv(name, appkey, devid):
...
@@ -474,6 +474,7 @@ def administration_user_application_device_download_csv(name, appkey, devid):
with
open
(
app
.
config
[
'DATA_DOWNLOAD_DIR_OS'
]
+
'/'
+
fn
,
'w+'
)
as
f
:
with
open
(
app
.
config
[
'DATA_DOWNLOAD_DIR_OS'
]
+
'/'
+
fn
,
'w+'
)
as
f
:
f
.
write
(
'utc,timestamp,'
)
f
.
write
(
'utc,timestamp,'
)
print
(
dev
)
for
d
in
dev
[
3
][
'format'
]:
for
d
in
dev
[
3
][
'format'
]:
f
.
write
(
d
)
f
.
write
(
d
)
f
.
write
(
','
)
f
.
write
(
','
)
...
@@ -481,8 +482,9 @@ def administration_user_application_device_download_csv(name, appkey, devid):
...
@@ -481,8 +482,9 @@ def administration_user_application_device_download_csv(name, appkey, devid):
for
row
in
dumpd
[
1
]:
for
row
in
dumpd
[
1
]:
f
.
write
(
'{},{},'
.
format
(
row
[
0
],
row
[
1
]))
f
.
write
(
'{},{},'
.
format
(
row
[
0
],
row
[
1
]))
for
v
in
row
[
2
]:
decoded
=
ddm
.
read_data
(
row
[
2
].
tobytes
(),
dev
[
3
])
f
.
write
(
str
(
row
[
2
][
v
]))
for
k
,
v
in
decoded
.
items
():
f
.
write
(
str
(
v
))
f
.
write
(
','
)
f
.
write
(
','
)
f
.
write
(
'
\n
'
)
f
.
write
(
'
\n
'
)
...
...
Write
Preview
Supports
Markdown
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