Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dares-fetcher
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
dbnomics-fetchers
dares-fetcher
Commits
2c8dd565
Commit
2c8dd565
authored
7 years ago
by
Constance de Quatrebarbes
Browse files
Options
Downloads
Patches
Plain Diff
Update to_source_data: revert to filepath based on url
parent
c087d0b3
No related branches found
Branches containing commit
No related tags found
1 merge request
!1
Implement download script and more
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dares_to_source_data.py
+4
-2
4 additions, 2 deletions
dares_to_source_data.py
with
4 additions
and
2 deletions
dares_to_source_data.py
+
4
−
2
View file @
2c8dd565
...
...
@@ -199,11 +199,13 @@ def main():
excel_data
=
fetch
(
ds
)
for
file
in
excel_data
:
response
=
requests
.
get
(
file
[
"
f_url
"
])
excel_file_path
=
os
.
path
.
join
(
target_dir
,
file
[
"
f_title
"
])
#reverting back to url filepath
filepath
=
file
[
"
f_url
"
].
split
(
"
/
"
)[
-
1
]
excel_file_path
=
os
.
path
.
join
(
target_dir
,
filepath
)
with
open
(
excel_file_path
,
"
wb
"
)
as
excel_file
:
excel_file
.
write
(
response
.
content
)
subprocess
.
check_call
(
[
'
git
'
,
'
add
'
,
file
[
"
f_title
"
]
],
[
'
git
'
,
'
add
'
,
file
path
],
cwd
=
target_dir
,
)
# Note: Ignore error occuring when there is nothing to commit.
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment