Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
osp
tools.ethertoff
Commits
37f5b9b1
Commit
37f5b9b1
authored
Aug 28, 2014
by
eric
Browse files
Ad-hoc: remove footnotes from the titles!
parent
04b6a508
Changes
1
Hide whitespace changes
Inline
Side-by-side
relearn/management/commands/index.py
View file @
37f5b9b1
...
...
@@ -3,6 +3,7 @@
# Python imports
import
os
import
re
import
sys
import
codecs
import
json
...
...
@@ -118,6 +119,13 @@ def query_results_to_template_articles(query_results):
if
'authors'
not
in
article
:
article
[
'authors'
]
=
[]
article
[
'authors'
].
append
(
value
)
if
key
==
"http://purl.org/dc/terms/title"
:
# Ad-hoc: remove footnotes from the titles!
print
"found title"
,
value
value
=
re
.
sub
(
r
'<sup>.*</sup>'
,
''
,
value
)
value
=
re
.
sub
(
r
'1$'
,
''
,
value
)
print
"encoding as"
,
value
article
[
'title'
]
=
value
else
:
new_key
=
short_names
[
key
]
article
[
new_key
]
=
value
...
...
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