2013-07-01 34 views
1

我借用配置文件中的想法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網站上,似乎由於某種原因transmogrifier.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 

回答

0

假設「的Plone」是你Plonesite的ID,改變/Plone路徑。

+0

因此,它假設id「Plone」?如果「Plone」不是ID,會怎麼樣? (我應該在這一點上閱讀代碼:))。 –

+0

:)的確,真的,也應該包含sitename,updatet答案。只是快速瀏覽了Alex Clark的例子,其中引用了「/」作爲路徑。你嘗試過'/ Plone'嗎?我偶然發現了這個看起來很有前途的腳本:https://github.com/zedr/wordpress2plone/blob/master/wp2plone.py –

+0

很想得到這個基於mr.migrator的腳本。與此同時,我從zedr和aclark獲得了一些想法,並將它們結合起來創建了我自己的WXR導入器版本。 https://github.com/collective/wordpress2plone –

相關問題