Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
genotoul-bioinfo
D-GENIES
Commits
6ff2f351
Commit
6ff2f351
authored
Apr 10, 2018
by
Floreal Cabanettes
Browse files
get latest version from github
parent
8ad80536
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/dgenies/md/INSTALL.md
View file @
6ff2f351
Install your own instance
=========================
{% if version != "" %}
Latest available version:
**{{version}}**
{% endif %}
Linux
-----
...
...
src/dgenies/views.py
View file @
6ff2f351
...
...
@@ -7,6 +7,8 @@ import shutil
import
re
import
threading
import
traceback
import
requests
import
json
from
flask
import
render_template
,
request
,
url_for
,
jsonify
,
Response
,
abort
,
send_file
,
Markup
from
pathlib
import
Path
from
dgenies.lib.paf
import
Paf
...
...
@@ -383,11 +385,19 @@ def documentation_dotplot():
@
app
.
route
(
"/install"
,
methods
=
[
'GET'
])
def
install
():
latest
=
""
call
=
requests
.
get
(
"https://api.github.com/repos/genotoul-bioinfo/dgenies/releases/latest"
)
if
call
.
ok
:
latest
=
json
.
loads
(
call
.
content
.
decode
(
"utf-8"
))
if
"tag_name"
in
latest
:
latest
=
latest
[
"tag_name"
][
1
:]
print
(
latest
)
with
open
(
os
.
path
.
join
(
app_folder
,
"md"
,
"INSTALL.md"
),
"r"
,
encoding
=
'utf-8'
)
as
install_instr
:
content
=
install_instr
.
read
()
env
=
Environment
()
template
=
env
.
from_string
(
content
)
content
=
template
.
render
(
version
=
VERSION
)
content
=
template
.
render
(
version
=
latest
)
md
=
Markdown
(
extensions
=
[
TocExtension
(
baselevel
=
1
)])
content
=
Markup
(
md
.
convert
(
content
))
toc
=
Markup
(
md
.
toc
)
...
...
Write
Preview
Supports
Markdown
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!
Cancel
Please
register
or
sign in
to comment