Bug patches and Product update
Hi, I have released a new version of the VisualZope Product (was VisualStudio but a certain company in Redmond has a product with the same name...). VZ now runs on top of and REQUIRES the following products: * XMLWidgets * Python Methods (with patch) * XMLDocument This is a development release and is not complete - please use the old version to build your widgets (the DTD has not changed) unless you are borrowing / looking at the code. Python Methods requires a simple patch to work. For some reason methods located within a ZClass crash upon creating a function with a self parameter. To fix this, goto the innermost line ref'd in the traceback and delete the "...and len(cofunc...)..." bit. Restart Zope. XMLDocument has lots of bugs in it (sorry Amos ;) most of which are fixed in the subclasses within VZ. One which I haven't patched yet is insertBefore(newchild, oldchild). For some reason if you pass it getFirstChild it will dup this node and then insert your newchild. There is lots of interesting code showing how to call child ZClass methods and Product supermethods, how to implement Product/Zclass conditional callbacks and how to use the ZDOM to the max. Useful stuff includes subclassing from other products at product level and walking up the aquisition tree to generate custom Add Object palettes. Nasty things are done to the aq_* metaattributes and some things will make you scream - so be warned! Please install it as per the instructions located @ http://www.zope.org/Members/NoneToBe/VisualStudio/new_html Cheers, Anthony Pfrunder
Anthony Pfrunder wrote: [announcement of VisualZope which I'll be installing now]
XMLDocument has lots of bugs in it (sorry Amos ;) most of which are fixed in the subclasses within VZ. One which I haven't patched yet is insertBefore(newchild, oldchild). For some reason if you pass it getFirstChild it will dup this node and then insert your newchild.
Have you mailed Amos/added these to the collector? I'm sure he'll appreciate this a lot. And me too -- I want XMLDocument to be as bugfree as possible. :) If you have anything for XMLWidgets, please mail me. :) Regards, Martijn
Hi there, I'm afraid I'm having trouble making this work. Anthony Pfrunder wrote: [snip]
Python Methods requires a simple patch to work. For some reason methods located within a ZClass crash upon creating a function with a self parameter. To fix this, goto the innermost line ref'd in the traceback and delete the "...and len(cofunc...)..." bit. Restart Zope.
I can't find the traceback. *which* traceback? I grepped VisualZope and PythonMethods but couldn't find any reference to 'len(cofunc', should I patch Zope itself? I'm wary to do that..
XMLDocument has lots of bugs in it (sorry Amos ;) most of which are fixed in the subclasses within VZ. One which I haven't patched yet is insertBefore(newchild, oldchild). For some reason if you pass it getFirstChild it will dup this node and then insert your newchild.
Studying the code and remembering some trickiness I encountered with ZDOM, I imagine it has to do with the following: when I insert a new node in Python, and then try to refer to that node, it doesn't work. Instead I need to get at the node through the ZDOM (for instance through getNextSibling(), if I just insert it below a node). In that case it does work. I can't get any of it to work. When I try the index_html in the example folder, I get: Error Type: AttributeError Error Value: _name Traceback (innermost last): File /home/zope/lib/python/ZPublisher/Publish.py, line 214, in publish_module File /home/zope/lib/python/ZPublisher/Publish.py, line 179, in publish File /home/zope/lib/python/Zope/__init__.py, line 201, in zpublisher_exception_hook (Object: ElementWithAttributes) File /home/zope/lib/python/ZPublisher/Publish.py, line 165, in publish File /home/zope/lib/python/ZPublisher/mapply.py, line 160, in mapply (Object: XMLWidgetManagerBase) File /home/zope/lib/python/ZPublisher/Publish.py, line 102, in call_object (Object: XMLWidgetManagerBase) File /home/zope/lib/python/Products/XMLWidgets/XMLWidgetManager.py, line 29, in __call__ (Object: XMLWidgetManagerBase) File /home/zope/lib/python/Products/VisualZope/vzManager.py, line 124, in render (Object: XMLWidgetManagerBase) AttributeError: (see above) When I try to add a Form, I get: Error Type: TypeError Error Value: too many arguments; expected 3, got 4 Traceback (innermost last): File /home/zope/lib/python/ZPublisher/Publish.py, line 214, in publish_module File /home/zope/lib/python/ZPublisher/Publish.py, line 179, in publish File /home/zope/lib/python/Zope/__init__.py, line 201, in zpublisher_exception_hook (Object: RoleManager) File /home/zope/lib/python/ZPublisher/Publish.py, line 165, in publish File /home/zope/lib/python/ZPublisher/mapply.py, line 160, in mapply (Object: Form_add) File /home/zope/lib/python/ZPublisher/Publish.py, line 102, in call_object (Object: Form_add) File /home/zope/lib/python/OFS/DTMLMethod.py, line 145, in __call__ (Object: Form_add) File /home/zope/lib/python/DocumentTemplate/DT_String.py, line 502, in __call__ (Object: Form_add) File /home/zope/lib/python/DocumentTemplate/DT_With.py, line 133, in render (Object: Form.createInObjectManager(REQUEST['id'], REQUEST)) File /home/zope/lib/python/DocumentTemplate/DT_Util.py, line 321, in eval (Object: Form.createInObjectManager(REQUEST['id'], REQUEST)) File <string>, line 0, in ? File /home/zope/lib/python/ZClasses/ZClass.py, line 419, in createInObjectManager (Object: Form) File /home/zope/lib/python/ZPublisher/mapply.py, line 161, in mapply (Object: Form) File /home/zope/lib/python/Products/VisualZope/vzManager.py, line 25, in __init__ (Object: XMLWidgetManagerBase) TypeError: (see above)
From the code, it looks like you patched XMLWidgets so that its init() function accepts an extra argument (the document?). My XMLWidgets is original and does not do what you want it to do. :) I'll be glad to study proposed patches, though.
Regards, Martijn
On Tue, 5 Oct 1999, Martijn Faassen wrote:
Hi there,
I'm afraid I'm having trouble making this work.
Hmm, another bug in Zope RE the aq_{} attributes. To get around this, click on the index_html form and use the View plane within it (NOT the view on the VisualStudio Examples folder) The exact patch for PythonMethods (latest development release 0.1.2 tested): File /home/Zope/lib/python/Products/PythonMethod/PythonMethod.py, line 132, in makeFunction: self._v_selfish = (fc.co_varnames and fc.co_varnames[0]=='self' and (fc.co_argcount - len(f.func_defaults) - 1)) change to: self._v_selfish = (fc.co_varnames and fc.co_varnames[0]=='self')
Studying the code and remembering some trickiness I encountered with ZDOM, I imagine it has to do with the following: when I insert a new node in Python, and then try to refer to that node, it doesn't work. Instead I need to get at the node through the ZDOM (for instance through getNextSibling(), if I just insert it below a node). In that case it does work.
Hmm, when you apply the fix above could you check out my code. I think that is what I did.
I can't get any of it to work. When I try the index_html in the example folder, I get:
See above You will still get javascript errors as I still have to rewrite the javascript library to use the new event system. I probably won't get around to it until 2 weeks from now (little thing called a thesis...) Cheers, Anthony Pfrunder
Anthony Pfrunder wrote: [snip patch to PythonMethods] Applied it.
Studying the code and remembering some trickiness I encountered with ZDOM, I imagine it has to do with the following: when I insert a new node in Python, and then try to refer to that node, it doesn't work. Instead I need to get at the node through the ZDOM (for instance through getNextSibling(), if I just insert it below a node). In that case it does work.
Hmm, when you apply the fix above could you check out my code. I think that is what I did.
I applied the PythonMethods fix, but that's unrelated to the XMLDocument problems I was talking about, right? [snip]
You will still get javascript errors as I still have to rewrite the javascript library to use the new event system. I probably won't get around to it until 2 weeks from now (little thing called a thesis...)
Looking at index_html directly with the view tab there helps; I applied the PythonMethod fix as well. I still get a traceback: Cannot locate object at: http://localhost:8080/VisualStudio_Examples/index_html/jscore Traceback (innermost last): File /home/zope/lib/python/ZPublisher/Publish.py, line 214, in publish_module File /home/zope/lib/python/ZPublisher/Publish.py, line 179, in publish File /home/zope/lib/python/Zope/__init__.py, line 201, in zpublisher_exception_hook (Object: ElementWithAttributes) File /home/zope/lib/python/ZPublisher/Publish.py, line 151, in publish File /home/zope/lib/python/ZPublisher/BaseRequest.py, line 334, in traverse File /home/zope/lib/python/ZPublisher/HTTPResponse.py, line 520, in debugError NotFound: (see above) When I select 'watermark' I get lots of raw HTML, included inside is this traceback: Error Type: cPickle.PicklingError Error Value: Cannot pickle <type 'CMethod'> objects. Traceback (innermost last): File /home/zope/lib/python/ZPublisher/Publish.py, line 214, in publish_module File /home/zope/lib/python/ZPublisher/Publish.py, line 179, in publish File /home/zope/lib/python/Zope/__init__.py, line 201, in zpublisher_exception_hook (Object: XMLWidgetManagerBase) File /home/zope/lib/python/ZPublisher/Publish.py, line 169, in publish File /home/zope/lib/python/ZODB/Transaction.py, line 237, in commit File /home/zope/lib/python/ZODB/Connection.py, line 321, in commit (Info: (('Products.XMLDocument.XMLDocument', 'Element'), '\000\000\000\000\000\000%8', '')) cPickle.PicklingError: (see above) I'm just passing along these traceback for information's sake; hopefully the third release in a few weeks is the one what works straight away. :) Regards, Martijn
On Wed, 6 Oct 1999, Martijn Faassen wrote:
You will still get javascript errors as I still have to rewrite the javascript library to use the new event system. I probably won't get around to it until 2 weeks from now (little thing called a thesis...)
Looking at index_html directly with the view tab there helps; I applied the PythonMethod fix as well. I still get a traceback: [snip] Cannot locate object at: http://localhost:8080/VisualStudio_Examples/index_html/jscore
That is the "missing" javascript library but it shouldn't give a traceback like that.
When I select 'watermark' I get lots of raw HTML, included inside is this traceback:
Error Type: cPickle.PicklingError Error Value: Cannot pickle <type 'CMethod'> objects.
[traceback snipped] Hmm, "pickling error"? If you click on the widget it should add it to the body of the form. I'm not sure why you are getting these tracebacks as I downloaded everything from the new_html (XMLWidgets, Methods, XML Document + VZ stuff) and installed it into a clean Zope distribution and tested that it worked correctly. When you view index_html it should display "This is an example of some widgets..." and when you view the source of the frame it should have a new division and some (incomplete) javascript code. Clicking on the watermark should add <watermark/> to the end of the document (and then WILL traceback until you remove the additional watermark or give it a name attribute). Anyone else getting these problems? BTW: Anyone checked out the ZEI? With a little rewrite of the javascript code we should have an XMLWidget for visually editing the HTML on both Netscape & IE! Cheers, Anthony Pfrunder
[snip]
Anyone else getting these problems?
Yep, I followed all your instructions but got nothing but tracebacks (not sure if they were exactly the same as Martijn's). If it works for you obviously we do something different :-\
BTW: Anyone checked out the ZEI? With a little rewrite of the javascript code we should have an XMLWidget for visually editing the HTML on both Netscape & IE!
That would be great - but doesn't the the ZEI example depend on a IE only HTMLText (or something alike) tag? Rik
At 11:18 PM 10/5/99 +1000, Anthony Pfrunder wrote:
VZ now runs on top of and REQUIRES the following products: * XMLWidgets * Python Methods (with patch) * XMLDocument
Cool, sounds like a winning combination! I can't wait to try it out.
XMLDocument has lots of bugs in it (sorry Amos ;) most of which are fixed in the subclasses within VZ. One which I haven't patched yet is insertBefore(newchild, oldchild). For some reason if you pass it getFirstChild it will dup this node and then insert your newchild.
I'd be happy to fix stuff if you provide me with detailed bug reports. Also, I love to receive patches. -Amos
participants (4)
-
Amos Latteier -
Anthony Pfrunder -
Martijn Faassen -
Rik Hoekstra