Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
radiopanik
panikdb
Commits
07037b05
Commit
07037b05
authored
Aug 25, 2013
by
fred
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
get breve logo as image if it exists
parent
a83f36f6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
1 deletion
+7
-1
panikdb/emissions/management/commands/load-from-spip.py
panikdb/emissions/management/commands/load-from-spip.py
+7
-1
No files found.
panikdb/emissions/management/commands/load-from-spip.py
View file @
07037b05
...
...
@@ -259,6 +259,7 @@ class Command(BaseCommand):
for
ext
in
(
'.jpg'
,
'.png'
,
'.gif'
):
if
os
.
path
.
exists
(
'media/IMG/rubon%s%s'
%
(
rubric
.
id_rubrique
,
ext
)):
image_path
=
[
'media/IMG/rubon%s%s'
%
(
rubric
.
id_rubrique
,
ext
)]
break
else
:
if
emission
.
text
:
image_path
=
re
.
findall
(
'src="/(media/IMG.*?)"'
,
emission
.
text
,
re
.
DOTALL
)
...
...
@@ -348,7 +349,12 @@ class Command(BaseCommand):
newsitem
.
text
=
makeHtmlFromSpip
(
breve
.
texte
,
documents
=
documents
)
or
None
newsitem
.
datetime
=
datetime
.
strptime
(
breve
.
date_heure
,
'%Y-%m-%d %H:%M:%S'
)
image_path
=
re
.
findall
(
'src="/(media/IMG.*?)"'
,
newsitem
.
text
,
re
.
DOTALL
)
for
ext
in
(
'.jpg'
,
'.png'
,
'.gif'
):
if
os
.
path
.
exists
(
'media/IMG/breveon%s%s'
%
(
breve
.
id_breve
,
ext
)):
image_path
=
[
'media/IMG/breveon%s%s'
%
(
breve
.
id_breve
,
ext
)]
break
else
:
image_path
=
re
.
findall
(
'src="/(media/IMG.*?)"'
,
newsitem
.
text
,
re
.
DOTALL
)
self
.
set_image
(
newsitem
,
image_path
)
newsitem
.
save
()
...
...
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