From: Alex R. <sh...@al...> - 2004-12-02 03:03:10
|
John, I've hacked a bit on your plugin, see attachment. Here's the short summary of what I've done and why. Please feel free to ask if I'm not clear. 1. I made the plugin writing functions the module-level functions. The structure seemed simple enough so that two functions can be used without a class. This is not all that important, just easier to read if you ask me :-) 2. The dump_dates() function is not being called as far as I could see. I guess you had plans for it, but so far it seems to be unused. 3. Most important change -- no BaseDoc for this plugin. As a consequence, no start_paragraph(), no styles, no self.doc.write_text() -- just a good ol' python f.write(), where f is the file-like object opened for writing (file, in our case). 4. The only class left in the report is a dialog class. This one is needed for setting up the dialog. Its purpose is to collect all necessary options from the user and then launch report-generating code. Since the general dialog class is set up with the assumptions of text/graphics (in the word-processor/graphical editor sense), there's a lot of assumed options and their corresponding widgets. Prevent the unneeded widgets from appearing, we need to redefine corresponding methods with empty (pass) statements, see the code. I can't think of anything important besides that, but please don't hesitate to ask. And really, looking at GraphViz.py is a good idea, since it's similarly a non-text/non-graphics but rather "code" plugin. Hope this helps, Alex -- Alexander Roitman http://ebner.neuroscience.umn.edu/people/alex.html Dept. of Neuroscience, Lions Research Building 2001 6th Street SE, Minneapolis, MN 55455 Tel (612) 625-7566 FAX (612) 626-9201 |