<?xml version="1.0"?>
<rss version="2.0">
  <channel>
    <title>Advogato blog for butchland</title>
    <link>http://www.advogato.org/person/butchland/</link>
    <description>Advogato blog for butchland</description>
    <language>en-us</language>
    <generator>mod_virgule</generator>
    <pubDate>Sat, 25 May 2013 02:44:09 GMT</pubDate>
    <item>
      <pubDate>Mon, 7 Aug 2000 18:44:20 GMT</pubDate>
      <title>7 Aug 2000</title>
      <link>http://www.advogato.org/person/butchland/diary.html?start=1</link>
      <guid>http://www.advogato.org/person/butchland/diary.html?start=1</guid>
      <description>&lt;ul&gt;
&lt;li&gt;&lt;b&gt;More Zope adventures&lt;/b&gt;
&lt;p&gt;
I'm working on a new project -- I'm trying to develop a set of tools that I can use to test &lt;a href="http://www.zope.org" &gt;Zope&lt;/a&gt; products -- in effect,
marrying Steve Purcell's &lt;a href="http://pyunit.sourceforge.net" &gt;PyUnit&lt;/a&gt; with Zope. My objective is to create a 
set of unit tests
for any Zope product or even internal Zope components... which will then enable me to  do &lt;a href="http://www.refactoring.com" &gt;XP-style 
refactoring&lt;/a&gt; stuff for my Zope projects...
&lt;p&gt;
I've thought about several approaches (including doing this via the medusa monitor) but I think the best approach
is to access Zope objects via the publish_module methods in the ZPublisher module...Of course, the downside of 
this   approach is that I can't test the ZServer side of the Zope stuff -- but since I'm not likely to be doing 
anything on that part of Zope, this is just fine  for me (and probably for a lot of other Zope developers as well).
&lt;p&gt;
&lt;b&gt;Where I am now:&lt;/b&gt; I've gotten to the point where I can call any object via its url string (e.g. '/index_html')
and get the HTML output. I think I can use this to build a coarse-grained unit testing framework -- I can capture
the HTML output, stick in some file, then run the unit test by comparing the HTML output from current run with
the HTML output from a file...
&lt;p&gt;
&lt;b&gt;Where I'd like to get to:&lt;/b&gt; I want to be able to access the actual objects and call their individual methods 
(e.g. -- &lt;i&gt;DTMLMethodObject1.__call__(client, REQUEST, RESPONSE,...)&lt;/i&gt;). Then I can do fine-grained 
unit tests.
&lt;p&gt;
One of the things I need to add is some setup routines to create fresh copies of the ZODB -- I can't
get a ZODB to get back to its original state even if i start undoing transactions and packing it...I've also
tried deleting everything and packing... its just not at the same size as it was before...
&lt;p&gt;
More Later...
 
&lt;/ul&gt;</description>
    </item>
    <item>
      <pubDate>Tue, 1 Aug 2000 23:45:06 GMT</pubDate>
      <title>1 Aug 2000</title>
      <link>http://www.advogato.org/person/butchland/diary.html?start=0</link>
      <guid>http://www.advogato.org/person/butchland/diary.html?start=0</guid>
      <description>&lt;ul&gt;
&lt;li&gt;&lt;b&gt;Zope Adventures&lt;/b&gt;
    &lt;p&gt;
I just downloaded the latest version of &lt;a href="http://www.zope.org" &gt;Zope&lt;/a&gt; (2.2) last Friday  
and started figuring out how it worked all over again.
&lt;p&gt;
It's been awhile since I touched anything Zope (or even &lt;a href="http://squishdot.org" &gt;Squishdot&lt;/a&gt;) -related
so I'm fumbling over stuff a little...
&lt;p&gt;
One of the nice things that's been added is the Zope Tutorial -- its bundled
with the basic Zope distribution, but its not documented anywhere so you
just kinda stumble into it while futzing around the management interface...
&lt;p&gt;
I started downloading and playing around with some of the &lt;a href="http://www.zope.org/Products" &gt;Zope 
Products&lt;/a&gt;. I found some of them
worked and some didn't... -- for those that didn't., I couldn't figure out whether
it was me who simply wasn't doing it right or whether it simply was broken...
I'm just guessing how many other people  couldn't figure them out either &lt;i&gt;(and 
just turned them off away from Zope)&lt;/i&gt; .  
&lt;p&gt;
One problem I had was that it was very hard
to figure out which Zope products (including the ones from DC) still worked with
the latest version... I'm suspecting it has a lot to do with the jump from 2.1 to 2.2
(which set up a new security mechanism -- of which I have no idea what had been changed -- haven't had 
time to grok the new security how-tos) broke a lot &lt;i&gt;(well, ok, &lt;b&gt;some&lt;/b&gt;)&lt;/i&gt; of these products...
My guess is that some of the broken products  won't be fixed pretty soon simply because they've been 
abandoned or their author(s) doesn't have the time to fix them... 
&lt;p&gt;
Of course, another problem was that even the quality of these Zope products varied greatly --
some were 'toy' products -- early attempts (some even abandoned attempts) at grokking
the Zope Zen... while some were really polished applications that had gone through extensive
debugging... but you wouldn't know it right away (unless you searched through the docs, mailing lists, etc. 
or tried it yourself -- which was what I did)... Documentation
quality also varied greatly -- from NONE to ones with lots of nice explanations and examples...
&lt;p&gt;
What would really be nice would be a "ratings" system that kinda gave you an idea of the
quality of the product right from the get-go...although two things might derail this: 1) what if product
authors started getting shy about publishing their work for fear of getting negative reviews? and 2) what if
the product users hesitated from giving negative reviews for fear of discouraging the product authors?
&lt;p&gt;
&lt;i&gt;Minor nitpick:&lt;/i&gt; There are some products &lt;i&gt; (written by authors who &lt;b&gt;really&lt;/b&gt; should
 know better...)&lt;/i&gt;  that unpacked themselves incorrectly by not supplying the correct path from
the installation home directory -- this is pretty common (and well-known)  "standard" that's followed by 
most -- why  can't they even bother to follow it?
&lt;p&gt;
One good change I've found since I last worked with Zope  is that there's more documentation now...
but you have to know your way around the site(s) to get what you want quickly... good thing I'm pretty familiar
with the layout so I generally found what I needed when I needed it...
&lt;p&gt;
So anyway, I started hacking...
&lt;p&gt;
&lt;i&gt;A digression:&lt;/i&gt;BTW, this is how I usually work with Zope -- I use the management interface (ie. through
the browser)
to create the DTML methods then I use ftp to download/upload the files between my editor and the
management interface... too bad this doesn't work with ZClass methods -- they're not visible through the
ftp interface... 
&lt;p&gt;
So anyway, after getting tired playing around with some of these products, I started futzing around with 
PythonMethods.
After searching through the Zope.org, I found a neat example that built a comics webpage. I copied it and
followed the install instructions, ran it and of course,&lt;i&gt; it didn't work&lt;/i&gt;.  The nice thing was it could be 
converted
to a python program and I could run/debug it as a regular python program... took me about 15 minutes to 
make it work. I converted back to a python method, and it ran under Zope...cool... Now I had a web page
full of funnies. But...
&lt;p&gt;
It ran kinda slow... I think it had something to do with all the gyrations it had to go through to figure
out the url of the comics image from all these different websites... It would all be fine if I could cache 
it then just refresh the cache once a day... so I go off and look at caching solutions...I found one 
(SimpleCache)  but it only refreshed itself if any of its dependent objects were updated... So I figure...umm...
If i build a method that updated  itself, and if the cache was set to be dependent on this then the cache would 
refresh itself too, -- but I had to have something that would call this method once a day... so I figured... maybe I 
could use Loren Stafford's ZScheduler to do this...
&lt;p&gt;
Except when I tried to use it, I couldn't make it run... it kept coming back with an error... I tried looking
for examples that worked, including the simplest one I found, but nothing worked... so either it didn't
work or I just couldn't figure out how... so I got stuck...(and that's where I left it)... 
&lt;p&gt;
Anyway, I took a fresh path and started another futzing project... this time with the Calendar product...
This one worked the first time out like a charm... Jon Udell had written a nice article that got me 
started... I added a simple ZClass-based Event object that had a date associated with it and also cataloged 
itself so I could use the Catalog in combo with the Calendar product to list events scheduled for a particular
day... I zoned out... built an Add page that added events (complete with validation)... so
now I had a toy scheduler...my mind is now buzzing with all the ideas on where to go with this one...
&lt;p&gt;
More later...
&lt;/ul&gt;</description>
    </item>
  </channel>
</rss>
