mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
parent
b9973bcf8a
commit
6888a04636
1 changed files with 13 additions and 2 deletions
|
|
@ -13,7 +13,12 @@ from pelican.utils import slugify
|
||||||
|
|
||||||
def wp2fields(xml):
|
def wp2fields(xml):
|
||||||
"""Opens a wordpress XML file, and yield pelican fields"""
|
"""Opens a wordpress XML file, and yield pelican fields"""
|
||||||
from BeautifulSoup import BeautifulStoneSoup
|
try:
|
||||||
|
from BeautifulSoup import BeautifulStoneSoup
|
||||||
|
except ImportError:
|
||||||
|
error = 'Missing dependency ' + \
|
||||||
|
'"BeautifulSoup" required to import Wordpress files.'
|
||||||
|
sys.exit(error)
|
||||||
|
|
||||||
xmlfile = open(xml, encoding='utf-8').read()
|
xmlfile = open(xml, encoding='utf-8').read()
|
||||||
soup = BeautifulStoneSoup(xmlfile)
|
soup = BeautifulStoneSoup(xmlfile)
|
||||||
|
|
@ -40,7 +45,13 @@ def wp2fields(xml):
|
||||||
|
|
||||||
def dc2fields(file):
|
def dc2fields(file):
|
||||||
"""Opens a Dotclear export file, and yield pelican fields"""
|
"""Opens a Dotclear export file, and yield pelican fields"""
|
||||||
from BeautifulSoup import BeautifulStoneSoup
|
try:
|
||||||
|
from BeautifulSoup import BeautifulStoneSoup
|
||||||
|
except ImportError:
|
||||||
|
error = 'Missing dependency ' + \
|
||||||
|
'"BeautifulSoup" required to import Dotclear files.'
|
||||||
|
sys.exit(error)
|
||||||
|
|
||||||
|
|
||||||
in_cat = False
|
in_cat = False
|
||||||
in_post = False
|
in_post = False
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue