On Fri, May 24, 2013 at 10:25 AM, Daniel DONATO <ddon...@unisa.it> wrote: > Sto provando a scrivere una browser view, però ogni volta che all'interno > della browser view, tento di importare le api di plone con: > > from plone import api > > si solleva un'eccezione: > > ImportError: cannot import name api >
plone.api non fa parte del Plone standard, l'hai aggiunto al tuo buildout? > > La browser view si chiama sacksviewview.py, questa è la parte di codice che > da errore: > > import EchoServerProtocol > from autobahn.websocket import WebSocketServerFactory, > WebSocketServerProtocol, listenWS > from twisted.internet import reactor > from zope.interface import implements, Interface > from Products.Five import BrowserView > from Products.CMFCore.utils import getToolByName > from zope.app.component.hooks import getSite > from net.riunioni import riunioniMessageFactory as _ > from plone import api > > > di seguito i messaggi che mi compaiono a terminale dove ho lanciato instance > fg: > > File > "/home/daniel/Plone/buildout-cache/eggs/Zope2-2.13.19-py2.7.egg/Zope2/Startup/run.py", > line 22, in run > starter.prepare() > File > "/home/daniel/Plone/buildout-cache/eggs/Zope2-2.13.19-py2.7.egg/Zope2/Startup/__init__.py", > line 86, in prepare > self.startZope() > File > "/home/daniel/Plone/buildout-cache/eggs/Zope2-2.13.19-py2.7.egg/Zope2/Startup/__init__.py", > line 262, in startZope > Zope2.startup() > File > "/home/daniel/Plone/buildout-cache/eggs/Zope2-2.13.19-py2.7.egg/Zope2/__init__.py", > line 47, in startup > _startup() > File > "/home/daniel/Plone/buildout-cache/eggs/Zope2-2.13.19-py2.7.egg/Zope2/App/startup.py", > line 118, in startup > load_zcml() > File > "/home/daniel/Plone/buildout-cache/eggs/Zope2-2.13.19-py2.7.egg/Zope2/App/startup.py", > line 52, in load_zcml > load_site() > File > "/home/daniel/Plone/buildout-cache/eggs/Zope2-2.13.19-py2.7.egg/Zope2/App/zcml.py", > line 46, in load_site > _context = xmlconfig.file(site_zcml) > File > "/home/daniel/Plone/buildout-cache/eggs/zope.configuration-3.7.4-py2.7.egg/zope/configuration/xmlconfig.py", > line 649, in file > include(context, name, package) > File > "/home/daniel/Plone/buildout-cache/eggs/zope.configuration-3.7.4-py2.7.egg/zope/configuration/xmlconfig.py", > line 548, in include > processxmlfile(f, context) > File > "/home/daniel/Plone/buildout-cache/eggs/zope.configuration-3.7.4-py2.7.egg/zope/configuration/xmlconfig.py", > line 380, in processxmlfile > parser.parse(src) > File "/home/daniel/Plone/Python-2.7/lib/python2.7/xml/sax/expatreader.py", > line 107, in parse > xmlreader.IncrementalParser.parse(self, source) > File "/home/daniel/Plone/Python-2.7/lib/python2.7/xml/sax/xmlreader.py", > line 123, in parse > self.feed(buffer) > File "/home/daniel/Plone/Python-2.7/lib/python2.7/xml/sax/expatreader.py", > line 207, in feed > self._parser.Parse(data, isFinal) > File "/home/daniel/Plone/Python-2.7/lib/python2.7/xml/sax/expatreader.py", > line 349, in end_element_ns > self._cont_handler.endElementNS(pair, None) > File > "/home/daniel/Plone/buildout-cache/eggs/zope.configuration-3.7.4-py2.7.egg/zope/configuration/xmlconfig.py", > line 359, in endElementNS > self.context.end() > File > "/home/daniel/Plone/buildout-cache/eggs/zope.configuration-3.7.4-py2.7.egg/zope/configuration/config.py", > line 558, in end > self.stack.pop().finish() > File > "/home/daniel/Plone/buildout-cache/eggs/zope.configuration-3.7.4-py2.7.egg/zope/configuration/config.py", > line 706, in finish > actions = self.handler(context, **args) > File > "/home/daniel/Plone/buildout-cache/eggs/zope.configuration-3.7.4-py2.7.egg/zope/configuration/xmlconfig.py", > line 548, in include > processxmlfile(f, context) > File > "/home/daniel/Plone/buildout-cache/eggs/zope.configuration-3.7.4-py2.7.egg/zope/configuration/xmlconfig.py", > line 380, in processxmlfile > parser.parse(src) > File "/home/daniel/Plone/Python-2.7/lib/python2.7/xml/sax/expatreader.py", > line 107, in parse > xmlreader.IncrementalParser.parse(self, source) > File "/home/daniel/Plone/Python-2.7/lib/python2.7/xml/sax/xmlreader.py", > line 123, in parse > self.feed(buffer) > File "/home/daniel/Plone/Python-2.7/lib/python2.7/xml/sax/expatreader.py", > line 207, in feed > self._parser.Parse(data, isFinal) > File "/home/daniel/Plone/Python-2.7/lib/python2.7/xml/sax/expatreader.py", > line 349, in end_element_ns > self._cont_handler.endElementNS(pair, None) > File > "/home/daniel/Plone/buildout-cache/eggs/zope.configuration-3.7.4-py2.7.egg/zope/configuration/xmlconfig.py", > line 359, in endElementNS > self.context.end() > File > "/home/daniel/Plone/buildout-cache/eggs/zope.configuration-3.7.4-py2.7.egg/zope/configuration/config.py", > line 558, in end > self.stack.pop().finish() > File > "/home/daniel/Plone/buildout-cache/eggs/zope.configuration-3.7.4-py2.7.egg/zope/configuration/config.py", > line 706, in finish > actions = self.handler(context, **args) > File > "/home/daniel/Plone/buildout-cache/eggs/zope.configuration-3.7.4-py2.7.egg/zope/configuration/xmlconfig.py", > line 548, in include > processxmlfile(f, context) > File > "/home/daniel/Plone/buildout-cache/eggs/zope.configuration-3.7.4-py2.7.egg/zope/configuration/xmlconfig.py", > line 380, in processxmlfile > parser.parse(src) > File "/home/daniel/Plone/Python-2.7/lib/python2.7/xml/sax/expatreader.py", > line 107, in parse > xmlreader.IncrementalParser.parse(self, source) > File "/home/daniel/Plone/Python-2.7/lib/python2.7/xml/sax/xmlreader.py", > line 123, in parse > self.feed(buffer) > File "/home/daniel/Plone/Python-2.7/lib/python2.7/xml/sax/expatreader.py", > line 207, in feed > self._parser.Parse(data, isFinal) > File "/home/daniel/Plone/Python-2.7/lib/python2.7/xml/sax/expatreader.py", > line 349, in end_element_ns > self._cont_handler.endElementNS(pair, None) > File > "/home/daniel/Plone/buildout-cache/eggs/zope.configuration-3.7.4-py2.7.egg/zope/configuration/xmlconfig.py", > line 359, in endElementNS > self.context.end() > File > "/home/daniel/Plone/buildout-cache/eggs/zope.configuration-3.7.4-py2.7.egg/zope/configuration/config.py", > line 558, in end > self.stack.pop().finish() > File > "/home/daniel/Plone/buildout-cache/eggs/zope.configuration-3.7.4-py2.7.egg/zope/configuration/config.py", > line 706, in finish > actions = self.handler(context, **args) > File > "/home/daniel/Plone/buildout-cache/eggs/zope.configuration-3.7.4-py2.7.egg/zope/configuration/xmlconfig.py", > line 548, in include > processxmlfile(f, context) > File > "/home/daniel/Plone/buildout-cache/eggs/zope.configuration-3.7.4-py2.7.egg/zope/configuration/xmlconfig.py", > line 380, in processxmlfile > parser.parse(src) > File "/home/daniel/Plone/Python-2.7/lib/python2.7/xml/sax/expatreader.py", > line 107, in parse > xmlreader.IncrementalParser.parse(self, source) > File "/home/daniel/Plone/Python-2.7/lib/python2.7/xml/sax/xmlreader.py", > line 123, in parse > self.feed(buffer) > File "/home/daniel/Plone/Python-2.7/lib/python2.7/xml/sax/expatreader.py", > line 207, in feed > self._parser.Parse(data, isFinal) > File "/home/daniel/Plone/Python-2.7/lib/python2.7/xml/sax/expatreader.py", > line 349, in end_element_ns > self._cont_handler.endElementNS(pair, None) > File > "/home/daniel/Plone/buildout-cache/eggs/zope.configuration-3.7.4-py2.7.egg/zope/configuration/xmlconfig.py", > line 359, in endElementNS > self.context.end() > File > "/home/daniel/Plone/buildout-cache/eggs/zope.configuration-3.7.4-py2.7.egg/zope/configuration/config.py", > line 558, in end > self.stack.pop().finish() > File > "/home/daniel/Plone/buildout-cache/eggs/zope.configuration-3.7.4-py2.7.egg/zope/configuration/config.py", > line 705, in finish > args = toargs(context, *self.argdata) > File > "/home/daniel/Plone/buildout-cache/eggs/zope.configuration-3.7.4-py2.7.egg/zope/configuration/config.py", > line 1397, in toargs > args[str(name)] = field.fromUnicode(s) > File > "/home/daniel/Plone/buildout-cache/eggs/zope.configuration-3.7.4-py2.7.egg/zope/configuration/fields.py", > line 227, in fromUnicode > v = vt.fromUnicode(s) > File > "/home/daniel/Plone/buildout-cache/eggs/zope.configuration-3.7.4-py2.7.egg/zope/configuration/fields.py", > line 137, in fromUnicode > value = self.context.resolve(name) > File > "/home/daniel/Plone/buildout-cache/eggs/zope.configuration-3.7.4-py2.7.egg/zope/configuration/config.py", > line 179, in resolve > mod = __import__(mname, *_import_chickens) > File > "/home/daniel/Plone/zinstance/src/net.riunioni/net/riunioni/browser/sacksviewview.py", > line 9, in <module> > from plone import api > zope.configuration.xmlconfig.ZopeXMLConfigurationError: File > "/home/daniel/Plone/zinstance/parts/instance/etc/site.zcml", line 15.2-15.55 > ZopeXMLConfigurationError: File > "/home/daniel/Plone/zinstance/parts/instance/etc/package-includes/002-net.riunioni-configure.zcml", > line 1.0-1.56 > ZopeXMLConfigurationError: File > "/home/daniel/Plone/zinstance/src/net.riunioni/net/riunioni/configure.zcml", > line 11.2-11.32 > ZopeXMLConfigurationError: File > "/home/daniel/Plone/zinstance/src/net.riunioni/net/riunioni/browser/configure.zcml", > line 7.2-14.8 > ImportError: cannot import name api > > _______________________________________________ > Plone-IT mailing list > plone...@lists.plone.org > https://lists.plone.org/mailman/listinfo/plone-plone-it > http://plone-regional-forums.221720.n2.nabble.com/Plone-Italy-f221721.html -- Saluti/Regards Luca Fabbri - RedTurtle Technology E-mail: luca.fab...@redturtle.it Web Site: http://www.redturtle.it/ Phone: +39 0532 1915958 Fax: +39 0532 287070 _______________________________________________ Plone-IT mailing list plone...@lists.plone.org https://lists.plone.org/mailman/listinfo/plone-plone-it http://plone-regional-forums.221720.n2.nabble.com/Plone-Italy-f221721.html