Changeset 3111
- Timestamp:
- 05/12/07 21:33:08 (13 years ago)
- Location:
- exist/trunk/python/ndgeXist
- Files:
-
- 1 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
exist/trunk/python/ndgeXist/ndgXqueries.py
r3110 r3111 3 3 ''' Holds a set of ndg xqueries after having read them from disk (which is 4 4 done in order to share the xqueries amongst different applications and 5 programming languages '''5 programming languages). ''' 6 6 def __init__(self,directory='xquery'): 7 7 ''' Loads up xqueries from the internal package directory ''' 8 8 files=pkg_resources.resource_listdir('ndgeXist',directory) 9 print files 10 self.xq=dict([(f.strip('.xq'),pkg_resources.resource_string(__name__,f)) for f in files]) 9 # this next bit to get rid of .svn and anything else in testing 10 xq=[] 11 for f in files: 12 if f.find('.xq')!=-1: xq.append(f) 13 self.xq=dict([(f.strip('.xq'),pkg_resources.resource_string('ndgeXist','%s/%s'%(directory,f))) for f in xq]) 11 14 def __setitem__(self,key,value): 12 ''' Add a new xquery to the xquery database '''15 ''' Add a new xquery to the xquery database dynamically''' 13 16 self.xq[key]=value 14 17 def __getitem__(self,key):
Note: See TracChangeset
for help on using the changeset viewer.