Accessing ZODB contents in an external method?
I need to run a report that is basically "What files are in this directory?" This directory now lives in the ZODB. Is there anyway to talk to the ZODB from an external method? --- Edward J. Pollard, B.Sc Webmaster, University of Lethbridge
I'm confused. You have a script which reports files in a specific filesystem directory. How can a filesystem directory live in ZODB? We can probably help once we understand what's happening. Troy
I need to run a report that is basically "What files are in this directory?"
This directory now lives in the ZODB.
Is there anyway to talk to the ZODB from an external method?
Edward Pollard wrote:
I need to run a report that is basically "What files are in this directory?"
This directory now lives in the ZODB.
Is there anyway to talk to the ZODB from an external method?
Yes, but you need to describe what you want to achieve in more details. -- hilsen/regards Max M, Denmark http://www.mxm.dk/ IT's Mad Science
On Fri, 2004-03-12 at 13:49, Edward Pollard wrote:
I need to run a report that is basically "What files are in this directory?"
This directory now lives in the ZODB.
Is there anyway to talk to the ZODB from an external method?
the self parameter to an external method provides a context back to the zodb.. def report(self): files = self.objectIds('File') return files if you meant fs directory than your question is worded poorly import os def report(self, dirname): path = os.path.join( os.environ['INSTANCE_HOME'], 'var', dirname) if not os.path.exist( path ): return None return os.listdir( path ) hth, -kapil
participants (4)
-
Edward Pollard -
Kapil Thangavelu -
Max M -
Troy Farrell