Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
Trèfle
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
6
Issues
6
List
Boards
Labels
Service Desk
Milestones
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Open source
Trèfle
Commits
958b631f
Commit
958b631f
authored
Jun 29, 2018
by
Yohan Boniface
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Catch invalid Intercarif XML
parent
59bbf26b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
3 deletions
+6
-3
remote/config.yml
remote/config.yml
+1
-1
setup.py
setup.py
+1
-1
trefle/routine.py
trefle/routine.py
+4
-1
No files found.
remote/config.yml
View file @
958b631f
...
...
@@ -2,7 +2,7 @@ ssh_key_urls:
ybon
:
http://nuage.yohanboniface.me/id_rsa.pub
regisb
:
http://minutebutterfly.com/id_rsa.pub
prod
:
version
:
0.3.
0
version
:
0.3.
1
username
:
yboniface
hostname
:
167.114.237.170
qa
:
...
...
setup.py
View file @
958b631f
...
...
@@ -16,7 +16,7 @@ def is_pkg(line):
with
open
(
'requirements.txt'
,
encoding
=
'utf-8'
)
as
reqs
:
install_requires
=
[
l
for
l
in
reqs
.
read
().
split
(
'
\n
'
)
if
is_pkg
(
l
)]
VERSION
=
(
0
,
3
,
0
)
VERSION
=
(
0
,
3
,
1
)
__author__
=
'Yohan Boniface'
__contact__
=
"yohan.boniface@data.gouv.fr"
...
...
trefle/routine.py
View file @
958b631f
...
...
@@ -117,7 +117,10 @@ async def populate_formation_from_bytes(context, content):
# Doc for leoh: http://lheo.gouv.fr/langage
# TODO: deal with action or session optional ids.
content
=
content
.
replace
(
b
' xmlns="http://www.lheo.org/2.2"'
,
b
''
)
tree
=
etree
.
fromstring
(
content
)
try
:
tree
=
etree
.
fromstring
(
content
)
except
etree
.
XMLSyntaxError
:
raise
UpstreamError
(
'UPSTREAM_ERROR: Invalid INTERCARIF XML'
)
root
=
tree
.
find
(
'offres/formation'
)
if
root
is
None
:
raise
ValueError
(
'No formation found'
)
...
...
Write
Preview
Markdown
is supported
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