Plone and Python scripts
I'm using Plone with Python scripts, I understand scripts are restricted in Plone and I also understand that I might create Python scripts in the Extensions folder for a fully functional script.
But how do I send information between the two scripts? For example script1.py is located in the ZMI and has a directory which is a URL, can a URL be exported as a Python path? Script2.py is located in the Plone Extensions folder, how do I send information from script1 to script2? and vice versa?
Also, Script2.py must be called by script1.py
Any help would be gratefu开发者_StackOverflow中文版l.
Python scripts in the Extensions folder are usually used as External Methods. This section of the Zope book explains External methods in more detail. Once this is created, you can call it by what id you give it in the ZMI by the other script or template in zope. You should be able to call it via your other script.
External methods are less recommended nowadays for unlimited Python powers, in favor of Browser Views which are Zope 3 Components, registered via ZCML and accessible from templates using context/@@name_of_your_view/your_method (TALES expression syntax).
Read more on http://plone.org/documentation/manual/developer-manual/archetypes/appendix-practicals/b-org-creating-content-types-the-plone-2.5-way/zope-3-views
精彩评论