Я заимствовал идеи из конфигурационных файлов по адресу https://github.com/aclark4life/wordpress2plone/, чтобы расширить свой сборник Plone 4.3.mr.migrator: wordpress2plone AttributeError: экземпляр контекста не имеет атрибута 'getPhysicalPath'
Цель состоит в том, чтобы сделать возможным импортировать данные, которые были экспортированы с сайта wordpress, на мой сайт Plone. Экспортированным форматом был Wordpress eXtended RSS (wxr).
Когда я запускаю следующую команду миграции,
bin/migrate --pipeline=pipeline.cfg
Я получаю следующее сообщение об ошибке:
AttributeError: Context instance has no attribute 'getPhysicalPath'
Вот полный отслеживающий:
Traceback (most recent call last):
File "bin/migrate", line 293, in <module>
sys.exit(mr.migrator.runner.runner())
File "/home/zope/Plone/buildout-cache/eggs/mr.migrator-1.0.1-py2.7.egg/mr/migrator/runner/__init__.py", line 132, in runner
transmogrifier(pipelineid, **overrides)
File "/home/zope/Plone/buildout-cache/eggs/collective.transmogrifier-1.4-py2.7.egg/collective/transmogrifier/transmogrifier.py", line 59, in __call__
pipeline = constructPipeline(self, sections)
File "/home/zope/Plone/buildout-cache/eggs/collective.transmogrifier-1.4-py2.7.egg/collective/transmogrifier/utils.py", line 56, in constructPipeline
pipeline)
File "/home/zope/Plone/buildout-cache/eggs/collective.transmogrifier-1.4-py2.7.egg/collective/transmogrifier/sections/splitter.py", line 132, in __init__
pipeline = constructPipeline(transmogrifier, sections, condition)
File "/home/zope/Plone/buildout-cache/eggs/collective.transmogrifier-1.4-py2.7.egg/collective/transmogrifier/utils.py", line 56, in constructPipeline
pipeline)
File "/home/zope/Plone/side/src/transmogrify.wordpress/transmogrify/wordpress/blueprints.py", line 300, in __init__
self.site_path = '/'.join(transmogrifier.context.getPhysicalPath())
AttributeError: Context instance has no attribute 'getPhysicalPath'
Я подозреваю, что это не найти мой экземпляр Plone, и мне интересно, есть ли что-то, что я не объявил о locati на моем сайте Plone кажется, что по какой-то причине transogrifier.context не устанавливается на мой сайт Plone.
Для дальнейшего использования опции в моем файле pipeline.cfg выглядеть следующим образом:
[options]
#Full path to the Wordpress WXR export file.
filename = /home/zope/Plone/side/myblog.wordpress.2013-06-29.xml
#Path, relative to the site root, of the folder where blog entries
#should be created.
#path = blog
path = Plone
#The desired portal_type for blog entries. Must be something with
#a 'text' field, and must already exist in the site. The default,
#'Blog Entry', may be obtained by installing Scrawl.
#type = Blog Entry
type = Page
#A CSS selector to find the body of a post within its full HTML page.
entry-selector = div.entry
Значит, он предполагает идентификатор «Plone»? Что делать, если «Plone» не является идентификатором? (Я действительно должен прочитать код на этом этапе :)). –
:) Истинное, истинное, должно содержать sitename, также, updatet ответ. Просто взглянул на пример Алекса Кларка, который цитирует «/» как путь. Вы пробовали использовать «/ Plone»? Я также наткнулся на этот сценарий, который выглядит многообещающим: https://github.com/zedr/wordpress2plone/blob/master/wp2plone.py –
Хотелось бы получить этот скрипт на основе mr.migrator. Тем временем я взял идеи от zedr и aclark и объединил их, чтобы создать свою собственную версию импортера WXR. https://github.com/collective/wordpress2plone –