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
pub
SupportPortal-aid
Commits
c41b2155
Commit
c41b2155
authored
Nov 13, 2018
by
Virgile Gerecke
🤘
Browse files
Merge branch 'release/2.0.1'
parents
74771d1d
38c9ef1b
Pipeline
#14790
passed with stage
in 39 seconds
Changes
3
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
.gitlab-ci.yml
View file @
c41b2155
stages
:
-
test
-
deploy
unittest
:
stage
:
test
...
...
@@ -10,3 +11,18 @@ unittest:
-
python3 verify.py
-
python3 display.py
pages
:
stage
:
deploy
script
:
-
pip3 install -r requirements.txt
-
python3 rss.py
-
mkdir target
-
mv rss.xml target
-
mv atom.xml target
-
mv target public
artifacts
:
paths
:
-
public
only
:
-
master
requirements.txt
View file @
c41b2155
anytree
==2.4.3
six
==1.11.0
feedgen
==0.7.0
python-slugify
==1.2.6
rss.py
0 → 100644
View file @
c41b2155
from
feedgen.feed
import
FeedGenerator
from
slugify
import
slugify
from
json
import
load
import
dateutil.parser
data
=
load
(
open
(
'weather.json'
,
'r'
))
def
df
(
date
):
dt
=
dateutil
.
parser
.
parse
(
date
)
return
dt
.
strftime
(
"%d/%m/%Y à %Hh%M"
)
fg
=
FeedGenerator
()
fg
.
id
(
'https://support.unistra.fr/'
)
fg
.
title
(
'Maintenance des services numériques'
)
fg
.
subtitle
(
'Annonces de la Direction du Numérique'
)
fg
.
link
(
href
=
'https://support.unistra.fr/#go-weather'
)
fg
.
language
(
'fr'
)
fg
.
link
(
href
=
'https://support.unistra.fr/atom.php'
,
rel
=
'self'
)
fg
.
author
(
name
=
'Direction du Numérique'
,
email
=
'support@unistra.fr'
)
fg
.
logo
(
'http://www.unistra.fr/fileadmin/templates/unistra/images/uds_ico.ico'
)
for
item
in
data
:
fe
=
fg
.
add_entry
()
title
=
item
[
'title'
]
fe
.
title
(
title
)
fe
.
id
(
slugify
(
title
))
content
=
"<p><b>Date de début : </b>{}</p><p><b>Date de fin : </b>{}</p>{}"
.
format
(
df
(
item
[
'start'
]),
df
(
item
[
'end'
]),
item
[
'content'
])
fe
.
description
(
content
)
fe
.
pubDate
(
item
[
'start'
])
rssfeed
=
fg
.
rss_str
(
pretty
=
True
)
fg
.
rss_file
(
'rss.xml'
)
atomfeed
=
fg
.
atom_str
(
pretty
=
True
)
fg
.
atom_file
(
'atom.xml'
)
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