Changeset 3111 for exist/trunk/python


Ignore:
Timestamp:
05/12/07 21:33:08 (12 years ago)
Author:
lawrence
Message:

eggification of xqueries proceeds ...

Location:
exist/trunk/python/ndgeXist
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • exist/trunk/python/ndgeXist/ndgXqueries.py

    r3110 r3111  
    33    ''' Holds a set of ndg xqueries after having read them from disk (which is 
    44    done in order to share the xqueries amongst different applications and  
    5     programming languages ''' 
     5    programming languages). ''' 
    66    def __init__(self,directory='xquery'): 
    77        ''' Loads up xqueries from the internal package directory ''' 
    88        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]) 
    1114    def __setitem__(self,key,value): 
    12         ''' Add a new xquery to the xquery database ''' 
     15        ''' Add a new xquery to the xquery database dynamically''' 
    1316        self.xq[key]=value 
    1417    def __getitem__(self,key): 
Note: See TracChangeset for help on using the changeset viewer.