Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
PLWN_API
Manage
Activity
Members
Labels
Plan
Issues
10
Issue boards
Milestones
Wiki
Redmine
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
Libraries
PLWN_API
Commits
eb9d5529
Commit
eb9d5529
authored
4 years ago
by
leszeks
Browse files
Options
Downloads
Patches
Plain Diff
pep8 fixes
parent
1408fe0d
Branches
Branches containing commit
1 merge request
!4
Adding download option
Pipeline
#1047
passed with stage
in 40 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
plwn/download.py
+3
-3
3 additions, 3 deletions
plwn/download.py
with
3 additions
and
3 deletions
plwn/download.py
+
3
−
3
View file @
eb9d5529
...
...
@@ -10,7 +10,7 @@ from six.moves.urllib.request import urlopen
config
=
configparser
.
ConfigParser
()
config_path
=
os
.
path
.
join
(
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
)),
"
config.ini
"
)
os
.
path
.
abspath
(
__file__
)),
"
config.ini
"
)
config
.
read
(
config_path
)
...
...
@@ -29,7 +29,7 @@ def get_available_models():
return
available_models
def
download
(
name
=
"
default_model
"
):
def
download
(
name
=
"
default_model
"
):
"""
After called it downloads a specified database model.
Currently only one model available.
...
...
@@ -44,7 +44,7 @@ def download(name = "default_model"):
return
if
name
in
models
:
url
=
config
[
"
DOWNLOAD
"
][
"
default_model
"
]
url
=
url
.
replace
(
"
plwn_dump_27-03-2018.sqlite
"
,
name
)
url
=
url
.
replace
(
"
plwn_dump_27-03-2018.sqlite
"
,
name
)
r
=
requests
.
get
(
url
)
with
open
(
name
,
"
wb
"
)
as
f
:
f
.
write
(
r
.
content
)
...
...
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