[Zope] want to use external script to read a text-file and image in database and modify REQUEST
Hi I want to use external methods to read a text file and image in database and modify the REQUEST my code looks like this varible --- def imageSetup(self, imageID, dataID, REQUEST): import PIL.Image from StringIO import StringIO # Get the original image and data in memory. image=getattr(self, imageID) imageData=getattr(self, dataID) imageFile=StringIO(str(image.data)) imageDataFile=StringIO(str(imageData.data)) # open image and data file im = PIL.Image.open(imageFile) tfw = open(imageDataFile, "r") # assign data coordinate and image size to variables imX,imY = im.size() rX=float(tfw.readline()) tfw.readline() tfw.readline() rY=float(tfw.readline()) mnX=float(tfw.readline()) mnY=float(tfw.readline()) mxX=mnX+imX*rX mxY=mnY+imY*rY # assign variables to REQUEST REQUEST.set('resX', rX) REQUEST.set('resY', rY) REQUEST.set('minX', mnX) REQUEST.set('minY', mnY) REQUEST.set('maxX', mxX) REQUEST.set('maxY', mxY) REQUEST.set('pixelX', imX) REQUEST.set('pixelY', imY) -- but all I get is this zope coercing to Unic ode: need string or buffer, instance found and the REQUEST variable is unchanged I'm still new to external scripting so I don't know what the problem is (and I think there is a lot of it here) so, could someone help me out?? Yahoo! Mail Use Photomail to share photos without annoying attachments.___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Dates off by one day
+---[ Kevin Carlson ]-- | Recently moved to a new server farm and am having a problem with dates | from MySQL that are rendered using strftime. The date in MySQL is | correct (e.g. 2005-01-22) but if the date is rendered with strftime the | date displayed is one day earlier (e.g., 2005-01-21). MySQL and Zope | are on separate servers as they were before the switch to the new | servers but this didn't happen in the old environment. | | Anyone have any thoughts on this? Sounds like something is applying a timezone transformation. Check the timezones on both the servers... -- Andrew Milton [EMAIL PROTECTED] ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
[Zope] Dates off by one day
Recently moved to a new server farm and am having a problem with dates from MySQL that are rendered using strftime. The date in MySQL is correct (e.g. 2005-01-22) but if the date is rendered with strftime the date displayed is one day earlier (e.g., 2005-01-21). MySQL and Zope are on separate servers as they were before the switch to the new servers but this didn't happen in the old environment. Anyone have any thoughts on this? Thanks, Kevin ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
[Zope] Re: Packing data.fs programmatically
On Fri, Feb 24, 2006 at 09:18:35PM +, Chris Withers wrote: | Derrick Hudson wrote: | >Chris, | > | >On Tue, Jan 31, 2006 at 01:36:36PM +, Chris Withers wrote: | >| ZEO & Stepper | > | >Is ZEO required to use Stepper? | | Yes, otherwise you'd have to shut down your Zope instance to run Stepper ;-) | | >Does 'zopectl run' require exclusive access to the database? (IOW | >must the zope server be stopped before zopectl run can be used?) | | Not if you're using ZEO. Thanks Paul and Chris. | >I just came across this thread and have a situation where this would | >be useful, however ZEO is not used for that deployment. | | Then introduce it, it's simple to set up and adds a world of | functionality! I could. I'd have to learn how to work with it :-). The deployments I've worked with are all single uniprocessor machines, thus ZEO wouldn't yield a performance improvement. I should learn ZEO one of these days. -D -- If you hold to [Jesus'] teaching, you are really [Jesus'] disciples. Then you will know the truth, and the truth will set you free. John 8:31-32 www: http://dman13.dyndns.org/~dman/jabber: [EMAIL PROTECTED] signature.asc Description: Digital signature ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Using ReStructuredText instead of StructuredDocument inside ZPT
Hello, OK, that makes sense in general - and what would that look like in my ZPT code? Can I access that method with just TAL, similar to Structured Document example: STX content renders here ...except with the render() in the path somewhere - where? Or do I have to use a python expression, and if so what would that look like? The only documentation I can find so far is the user documentation... thanks, John S. --- Andreas Jung <[EMAIL PROTECTED]> wrote: > --On 23. Februar 2006 23:18:06 -0800 John Schinnerer > <[EMAIL PROTECTED]> wrote: > > > > This is on zope 2.7.5 with the ZReST that comes "built in." > > A RSTD called directly (instead of inside a ZPT as above) renders > as > > expected. > > > > Try using the 'render()' method. > > -aj __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Packing data.fs programmatically
On Fri February 24 2006 16:19, Chris Withers wrote: > >> URL whacking is evil and must be punished... > > > > How is this different than clicking on the Pack button in the ZMI? > > That's also evil, because yes, it is just URL whacking with a browser... Ok. So there is no difference. > > What's > > the solution without ZEO and without having to stop Zope? > > You use ZEO. Get over it, it should be how a standard Zope instance is > set up, IMNSHO... So, in other words, there isn't one. I take it you're a big fan of ZEO. ;-) I guess I'll check it out. I've been using Zope for 7-ish years and just never bothered. -- Ron ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Storing things in the session from ZPT
On 24 Feb 2006, at 12:49, Robert (Jamie) Munro wrote: How can I put something in a session from ZPT? I've tried: Isn't it Doing this kind of logic from ZPT is evil :-( Do I really have to write a python method just to assign a single value? Yes, put all you logic in a python script. See Zope 3 views for an event cleaner way :-) cheers, Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
[Zope] Re: Packing data.fs programmatically
Derrick Hudson wrote: Chris, On Tue, Jan 31, 2006 at 01:36:36PM +, Chris Withers wrote: | ZEO & Stepper Is ZEO required to use Stepper? Yes, otherwise you'd have to shut down your Zope instance to run Stepper ;-) Does 'zopectl run' require exclusive access to the database? (IOW must the zope server be stopped before zopectl run can be used?) Not if you're using ZEO. I just came across this thread and have a situation where this would be useful, however ZEO is not used for that deployment. Then introduce it, it's simple to set up and adds a world of functionality! Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] image processing site quidance...
Nicolas Georgakopoulos wrote: That's the point , I think it will be easier (for me) if I write a python program that is called by Zope external method to make the image processing in the local file system. So the image files should be uploaded in the local files system to be processed and then able to be read it from Zope to be displayed and downloaded Sounds fine, LocalFS or Infrae's Railroad or Tramlines are ways you might want to look at server the generated images out once you've made them and saved them on the local file system... cheers, Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Packing data.fs programmatically
Ron Bickers wrote: On Tue January 31 2006 07:47, Chris Withers wrote: I do it though the webinterface with a wget from the crontab: Oh, ouch ouch bad fragile pain failure suffering... URL whacking is evil and must be punished... How is this different than clicking on the Pack button in the ZMI? That's also evil, because yes, it is just URL whacking with a browser... What's the solution without ZEO and without having to stop Zope? You use ZEO. Get over it, it should be how a standard Zope instance is set up, IMNSHO... Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Possible to run Zope on a shared host?
Marty McFly wrote: Unfortunately, I don't have any of those privileges... I only have write-access to my personal home-directory. Do you have an idea what I could do instead? I think you should consider getting some proper hosting, this isn't going to work for any serious Zope use... Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Re: CMFExternalFile and huge ZODB pickles
Pawel Lewicki wrote: Class Name CountTBytesPct AvgSize -- --- - - --- ... OFS.Folder.Folder 2731 7177565156 95.4% 2628182.04 The only reference to folder I have is: folder.manage_addProduct['ExternalFile'].addExternalFile(filename, '', '',filepath, '',file) Well yes, you're adding an external file to the folder. That changes the folder, so a new copy of it will get written to the ZODB, hence the growth you're seeing. try using a BTreeFolder2 or similar for whatever 'folder' is... cheers, Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] change ATImage metadata
> The language attribute is a standard Archetypes field, and as such youcan ask such fields what it's accesor and mutator are: Cool, now I know how to do it for any other attribute. Thank you. -- Milos Prudek ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] limiting view access to acl_users
gf wrote: On 2/24/06, David <[EMAIL PROTECTED]> wrote: gf wrote: Hi, I am relatively new to Zope and have a question regarding acl_user folders. I am trying to prevent 'view' access to an acl_users folder that I have created in a non-root area of my website. I have used the management interface Security tab to uncheck the 'Acquire permission settings' for the 'View' Permission and have enabled View for the Manager role only. I have taken the same actions for my root acl_users folder as well. When I browse to http://mysite/myfolder/acl_users, I am presented with a view of the index_html file contained within myfolder, with the 'output' indicating that it is 'User Folder'. Why is acl_users making use of the container's index_html? Is there a way to limit even View access to this folder? Thanks. -g gf, Thats normal zope acquisition. When you access a folder with no viewable object it goes *up* in search of something to acquire and index_html is implied. Authorization occurs when something is about to be published or accessed - not just typed in a URL. David Hi David, I appreciate the clear explanation. That certainly makes sense. Does that mean, then, that it is not really possible to limit view access like I want without some 'extraordinary' measures? Is it possible to have this particular folder type acquire some other object instead of index_html? I suppose if I could redirect to another folder that would be sufficient. Thanks. -g gf, So far you haven't described how they "view" acl_users. Which is what I thought was your concern.. They are viewing the first (authenticated) viewable object which is one level above. Maybe you can better define your security concerns. What don't you want users to see? David ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] limiting view access to acl_users
On 2/24/06, David <[EMAIL PROTECTED]> wrote: > gf wrote: > > >Hi, > >I am relatively new to Zope and have a question regarding acl_user folders. > > > >I am trying to prevent 'view' access to an acl_users folder that I > >have created in a non-root area of my website. > > > >I have used the management interface Security tab to uncheck the > >'Acquire permission settings' for the 'View' Permission and have > >enabled View for the Manager role only. > > > >I have taken the same actions for my root acl_users folder as well. > > > >When I browse to http://mysite/myfolder/acl_users, I am presented with > >a view of the index_html file contained within myfolder, with the > > 'output' indicating that it is 'User Folder'. > > > >Why is acl_users making use of the container's index_html? Is there a > >way to limit even View access to this folder? > > > >Thanks. > > > >-g > > > > > gf, > > Thats normal zope acquisition. When you access a folder with no > viewable object it goes *up* in search of something to acquire and > index_html is implied. Authorization occurs when something is about to > be published or accessed - not just typed in a URL. > > David > > Hi David, I appreciate the clear explanation. That certainly makes sense. Does that mean, then, that it is not really possible to limit view access like I want without some 'extraordinary' measures? Is it possible to have this particular folder type acquire some other object instead of index_html? I suppose if I could redirect to another folder that would be sufficient. Thanks. -g ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] limiting view access to acl_users
gf wrote: Hi, I am relatively new to Zope and have a question regarding acl_user folders. I am trying to prevent 'view' access to an acl_users folder that I have created in a non-root area of my website. I have used the management interface Security tab to uncheck the 'Acquire permission settings' for the 'View' Permission and have enabled View for the Manager role only. I have taken the same actions for my root acl_users folder as well. When I browse to http://mysite/myfolder/acl_users, I am presented with a view of the index_html file contained within myfolder, with the 'output' indicating that it is 'User Folder'. Why is acl_users making use of the container's index_html? Is there a way to limit even View access to this folder? Thanks. -g gf, Thats normal zope acquisition. When you access a folder with no viewable object it goes *up* in search of something to acquire and index_html is implied. Authorization occurs when something is about to be published or accessed - not just typed in a URL. David ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
[Zope] limiting view access to acl_users
Hi, I am relatively new to Zope and have a question regarding acl_user folders. I am trying to prevent 'view' access to an acl_users folder that I have created in a non-root area of my website. I have used the management interface Security tab to uncheck the 'Acquire permission settings' for the 'View' Permission and have enabled View for the Manager role only. I have taken the same actions for my root acl_users folder as well. When I browse to http://mysite/myfolder/acl_users, I am presented with a view of the index_html file contained within myfolder, with the 'output' indicating that it is 'User Folder'. Why is acl_users making use of the container's index_html? Is there a way to limit even View access to this folder? Thanks. -g ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Debugging doctests
On 24 Feb 2006, at 16:38, Tres Seaver wrote: So, I take it that you are a second voter in favor of not requiring all tests to be doctests. Count me as another. Doctests are fine for many cases, but they suck for doing "coverage" / "edge case" testing, which are the "valuable" unit tests for my applications. I would note that the usefulness of a doctest as documentation is inversely proportional to the amount of "setup noise" the test requires. Another argument against the doctest requirement is the fact that you have great packages out there with very extensive "standard" unit tests. Rewriting those to doctests just for this requirement would be asking just a tad too much. jens ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
[Zope] [ANN] Zope 2.9.1 released
Hi all, on behalf of Zope Corporation and the Zope community I am pleased to announce the release of Zope 2.9.1. You can download it from http://www.zope.org/Products/Zope/2.9.1/ Some new features of Zope 2.9: - ZODB 3.6 - Five 1.2 - integration for Zope 3 events for object creation and deletion - Zope 3 i18n integration for page templates For more information on what is new in this release, see the CHANGES.txt files for the release: http://www.zope.org/Products/Zope/2.9.1/CHANGES.txt Please bring all the bugs you have found to the Zope bugtracker: "http://collector.zope.org/Zope":http://collector.zope.org/Zope For more information on the available Zope releases, guidance for selecting the right distribution and installation instructions, please see: http://www.plope.com/Books/2_7Edition/InstallingZope.stx Support Python versions: Zope 2.9 requires Python 2.4.2 (Python 2.4.1 is still acceptable). Older Python versions are no longer supported. Thanks to all being involved in this release. -- Andreas Jung(andreas at zopyx dot com) pgpyB1PcncJMw.pgp Description: PGP signature ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
[Zope] [ANN] Zope 2.8.6 released
Hi all, on behalf of Zope Corporation and the Zope community I am pleased to announce the release of Zope 2.8.6. You can download Zope 2.8.6 from http://www.zope.org/Products/Zope/2.8.6/ Some new features of Zope 2.8: - ZODB 3.4 with MVCC (multi version concurrency control) support. MVCC solves nearly every problem with ZODB read-conflict errors which is very important for high-traffic Zope sites. - Extension Classes were rewritten as Python new-style classes making all features of Python new-style classes available in Zope objects. This includes support for cyclic garbage collection. - Integration of Zope 3 technologies through Five (see http://codespeak.net/z3/five/) For more information on what is new in this release, see the CHANGES.txt files for the release: http://www.zope.org/Products/Zope/2.8.6/CHANGES.txt See also: http://www.zope.org/Wikis/DevSite/Projects/Zope2.8/OverView Please bring all the bugs you have found to the Zope bugtracker: http://collector.zope.org/Zope":http://collector.zope.org/Zope For more information on the available Zope releases, guidance for selecting the right distribution and installation instructions, please see: http://www.plope.com/Books/2_7Edition/InstallingZope.stx Please also keep in mind that Zope 2.8.6 requires Python 2.3.5. Zope 2.8.6 is not certified for any Python 2.4.x versions. So using Python 2.4 is neither recommended nor supported and any related questions or problems are likely to be ignored until 2.4 is an officially supported Python version for Zope. -- Andreas Jung(andreas at zopyx dot com) pgpI5HMtd5nWZ.pgp Description: PGP signature ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Debugging doctests
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Stephan Richter wrote: > On Thursday 23 February 2006 14:16, Chris McDonough wrote: > >> (e.g. high- >>level overview of purpose, how to install it, what other packages it >>depends upon, which versions of Python/Zope it works with, who is >>responsible for maintaining the package, where to report bugs, and so >>on). I suppose this is really a packaging issue, but it would be >>nice if more packages in the zope namespace package were treated as >>"islands" like this that could be installed separately from Zope >>proper. > > > The ZSCP tries to exactly capture this information and provide it via its > site. > > So, I take it that you are a second voter in favor of not requiring all tests > to be doctests. Count me as another. Doctests are fine for many cases, but they suck for doing "coverage" / "edge case" testing, which are the "valuable" unit tests for my applications. I would note that the usefulness of a doctest as documentation is inversely proportional to the amount of "setup noise" the test requires. Tres. - -- === Tres Seaver +1 202-558-7113 [EMAIL PROTECTED] Palladion Software "Excellence by Design"http://palladion.com -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.1 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFD/yhq+gerLs4ltQ4RAk7sAKDILanq+5mbgsq/z0tOHiZpmph1IQCeO+dH Z5ulUBVEml+wxexIwyeF6w0= =anV3 -END PGP SIGNATURE- ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] attribute used to index PDFs?
Hmm? I must have missed where it was suggested in this old thread to enter this "issue" into the bug tracker. At any rate, what I eventually concluded was that this really isn't an issue, just a misconception I had about what TXNG3 actually provides as native indexing support (given the appropriately installed converters). Assuming the user isn't using Plone or something else that provides a TXNG hook into the File's data, the user still needs to write the appropriate adapter to get the indexer to pull the raw data from the object to then be converted and indexed. This was a bit of a change from what I was used to with TXNG2 which does know how to pull the data from File objects. Since I didn't have enough time to research what was involved in writing an adapter, I fell back to using TXNG2. It worked well and accomplished what I needed. Garth On 2/24/06, Andreas Jung <[EMAIL PROTECTED]> wrote: > > > --On 12. Dezember 2005 14:54:09 -0500 "Garth B." <[EMAIL PROTECTED]> wrote: > > > On closer inspection, the Word docs aren't actually being indexed > > appropriately either. When I browse the vocabulary for these indexed > > Word docs, I happen to see textual content that can be seen by also > > cat'ing the document to the stdout. The vocab includes other strings > > that certainly are not content. I guess they're string > > representations of binary content. > > > > These are other things that I noticed, maybe they won't amount to > > anything: > > > > - When I watch the processes during indexing w/top I don't see wvWare > > or pdftotext appear. Maybe they won't. > > > > - I also inserted a couple of LOG.warn's in src/textindexng/content.py > > around line 130 ( if d.has_key('mimetype'): ), and this test always > > fails, thereby skipping conversion. > > > > - Digging further in this file, "mimetype" is only defined when > > extract_content() in content.py calls "icc.addBinary(...)". This only > > happens when the indexed object provides a txng_get() hook (or I > > suppose if an adapter exists). That whole block (around lines 81 - > > 93) never gets hit with my PDFs or Word docs during indexing. When I > > index a large number of PDFs I will get a number of TypeErrors raised > > around line 110 when extract_content() notices that the data isn't a > > [unicode] string. > > > > Is the standard Zope File object supposed to expose a txng_get hook? > > > > On 12/12/05, Garth B. <[EMAIL PROTECTED]> wrote: > >> Hi Andreas, > >> > >> Neither PrincipiaSearchSource nor SearchableText does anything for > >> these File-type objects. I guess nothing for SearchableText is > >> expected since these are not CMF or Plone-derived objects. The only > >> way I've managed to get *anything* indexed for these File-type objects > >> is by specifying the "data" attribute. > >> > >> A couple of related postings that I've found through a bit of Googling > >> have also noted having to use "data" when indexing these kinds of > >> files, for example: > >> http://mail.zope.org/pipermail/zope/2003-August/139702.html > >> > >> So, I should be able to use PrincipiaSearchSource? I've only used > >> that for text-oriented objects like Page Templates. I'll keep digging > >> around, but I welcome any suggestions for what the problem could be or > >> how I can debug this further. > > Maybe you should bring this to TXNG bugtracker (as suggested!). > > -aj ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Storing things in the session from ZPT
Robert (Jamie) Munro schrieb: How can I put something in a session from ZPT? I've tried: Do I really have to write a python method just to assign a single value? No you can use the method for all the other work too... You should avoid application logic in your templates. You can do that but its ugly. stop-using-defines-ly Tino ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Storing things in the session from ZPT
On 24 Feb 2006, at 12:49, Robert (Jamie) Munro wrote: How can I put something in a session from ZPT? I've tried: Isn't it Do I really have to write a python method just to assign a single value? Robert (Jamie) Munro ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev ) -- Peter Bengtsson, work www.fry-it.com home www.peterbe.com hobby www.issuetrackerproduct.com ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope3-Users] Re: [Zope] Debugging doctests
On Thursday 23 February 2006 17:18, Chris McDonough wrote: > On Feb 23, 2006, at 4:51 PM, Stephan Richter wrote: > > So, I take it that you are a second voter in favor of not requiring > > all tests > > to be doctests. > > If the ZSCP thing takes off, I think test/doc req'ts should be > somewhat looser than mandating a particular test/doc framework > (something along the lines of "must have good test coverage and > appropriate narrative documentation", maybe with examples of what > this means that could be in doctest format by default). Would that > be acceptable? If there is enough outcry by developers, then yes. ;-) The problem is that it becomes hard to verify that documentation does not deteriorate over time. That means we need certification manager overhead to check that; and it would actually be a difficult task. With doctests I can at least force the developer to update the documentation examples, and if s/he is interested in his package at all, s/he will update the text around it as well. BTW, I have no problem to make the requirements tool independent. I could do the following changes: Doctest-based Testing --> Documentation-based Testing Actually I just did. Maybe I should also change:: Minimal Documentation --> Minimal, Testable Documentation Complete Documentation --> Complete, Testable Documentation Mmmh, now that I look at the matrix, I really think I should have a small explanatory snippet for each metric (below the matrix). Regards, Stephan -- Stephan Richter CBU Physics & Chemistry (B.S.) / Tufts Physics (Ph.D. student) Web2k - Web Software Design, Development and Training ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Storing things in the session from ZPT
--On 24. Februar 2006 12:49:48 + "Robert (Jamie) Munro" <[EMAIL PROTECTED]> wrote: How can I put something in a session from ZPT? I've tried: Do I really have to write a python method just to assign a single value? Did you consider reading the whole SESSIONS chapter in the Zope Book 2.7 edition? -aj pgpTdBAEirO92.pgp Description: PGP signature ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
[Zope] Storing things in the session from ZPT
How can I put something in a session from ZPT? I've tried: Do I really have to write a python method just to assign a single value? Robert (Jamie) Munro ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope3-Users] Re: [Zope] Debugging doctests
On 2/23/06, Stephan Richter <[EMAIL PROTECTED]> wrote: > On Thursday 23 February 2006 13:37, Lennart Regebro wrote: > > Not to mention, doctests are not debuggable from WingIDE. > > Maybe we should have a WingIDE sprint in Boston at some point. This would be a > good topic. Let's do this somewhere I can get to without having to cross the Atlantic; Pareto will be far more likely to pay for my presence that way.. -- Martijn Pieters ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope3-Users] Re: [Zope] Debugging doctests
On 2/24/06, Martijn Pieters <[EMAIL PROTECTED]> wrote: > On 2/23/06, Lennart Regebro <[EMAIL PROTECTED]> wrote: > > Not to mention, doctests are not debuggable from WingIDE. ;-) > > In 2.1 you can; the following is the equivalent of pdb.set_trace(): > > wingdbstub.debugger.Break() > > :) Oh, cool. I need to get 2.1. :) -- Lennart Regebro, Nuxeo http://www.nuxeo.com/ CPS Content Management http://www.cps-project.org/ ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope3-Users] Re: [Zope] Debugging doctests
On 2/23/06, Lennart Regebro <[EMAIL PROTECTED]> wrote: > Not to mention, doctests are not debuggable from WingIDE. ;-) In 2.1 you can; the following is the equivalent of pdb.set_trace(): wingdbstub.debugger.Break() :) -- Martijn Pieters ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Using ReStructuredText instead of StructuredDocument inside ZPT
--On 23. Februar 2006 23:18:06 -0800 John Schinnerer <[EMAIL PROTECTED]> wrote: This is on zope 2.7.5 with the ZReST that comes "built in." A RSTD called directly (instead of inside a ZPT as above) renders as expected. Try using the 'render()' method. -aj pgpxSpBurtzWo.pgp Description: PGP signature ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] attribute used to index PDFs?
--On 12. Dezember 2005 14:54:09 -0500 "Garth B." <[EMAIL PROTECTED]> wrote: On closer inspection, the Word docs aren't actually being indexed appropriately either. When I browse the vocabulary for these indexed Word docs, I happen to see textual content that can be seen by also cat'ing the document to the stdout. The vocab includes other strings that certainly are not content. I guess they're string representations of binary content. These are other things that I noticed, maybe they won't amount to anything: - When I watch the processes during indexing w/top I don't see wvWare or pdftotext appear. Maybe they won't. - I also inserted a couple of LOG.warn's in src/textindexng/content.py around line 130 ( if d.has_key('mimetype'): ), and this test always fails, thereby skipping conversion. - Digging further in this file, "mimetype" is only defined when extract_content() in content.py calls "icc.addBinary(...)". This only happens when the indexed object provides a txng_get() hook (or I suppose if an adapter exists). That whole block (around lines 81 - 93) never gets hit with my PDFs or Word docs during indexing. When I index a large number of PDFs I will get a number of TypeErrors raised around line 110 when extract_content() notices that the data isn't a [unicode] string. Is the standard Zope File object supposed to expose a txng_get hook? On 12/12/05, Garth B. <[EMAIL PROTECTED]> wrote: Hi Andreas, Neither PrincipiaSearchSource nor SearchableText does anything for these File-type objects. I guess nothing for SearchableText is expected since these are not CMF or Plone-derived objects. The only way I've managed to get *anything* indexed for these File-type objects is by specifying the "data" attribute. A couple of related postings that I've found through a bit of Googling have also noted having to use "data" when indexing these kinds of files, for example: http://mail.zope.org/pipermail/zope/2003-August/139702.html So, I should be able to use PrincipiaSearchSource? I've only used that for text-oriented objects like Page Templates. I'll keep digging around, but I welcome any suggestions for what the problem could be or how I can debug this further. Maybe you should bring this to TXNG bugtracker (as suggested!). -aj pgp2rVKV7RYoQ.pgp Description: PGP signature ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )