/[papo]/gnue/reports/src/GRFilters.py
ViewVC logotype

Diff of /gnue/reports/src/GRFilters.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1 by charlie, Fri Jun 28 19:43:54 2002 UTC revision 1.2 by styxman, Thu Nov 14 23:02:37 2002 UTC
# Line 27  Line 27 
27  # NOTES:  # NOTES:
28  #  #
29    
30  from gnue.common import GConfig, GDebug, openResource, dyn_import  from gnue.common import GConfig, GDebug
31    from gnue.common.FileUtils import openResource, dyn_import
32  from ConfigParser import *  from ConfigParser import *
33  import os, sys, string  import os, sys, string
34    
# Line 63  class GRFilters: Line 64  class GRFilters:
64      except KeyError:      except KeyError:
65        raise FilterError, "Filter configuration file does not contain an 'engine=' for %s" % filter        raise FilterError, "Filter configuration file does not contain an 'engine=' for %s" % filter
66    
67        parameters ['_filterbase'] = self._config.filterBase
68    
69      adapter = module.TransformAdapter(destination, parameters, filter_options)      adapter = module.TransformAdapter(destination, parameters, filter_options)
70      return adapter      return adapter
71    
# Line 85  class GRFilterConfig: Line 88  class GRFilterConfig:
88          location = os.path.join(          location = os.path.join(
89              GConfig.getInstalledBase('reports_etc','common_etc','install_prefix'),              GConfig.getInstalledBase('reports_etc','common_etc','install_prefix'),
90              location )              location )
       print location  
91        self.readConfig(location)        self.readConfig(location)
92    
93    
# Line 124  class GRFilterConfig: Line 126  class GRFilterConfig:
126      if filterBase[0] != '/':      if filterBase[0] != '/':
127        filterBase = os.path.join(GConfig.getInstalledBase('reports_shared', 'common_shared'), filterBase)        filterBase = os.path.join(GConfig.getInstalledBase('reports_shared', 'common_shared'), filterBase)
128    
129        self.filterBase = filterBase
130    
131      # Pull in all the other sections      # Pull in all the other sections
132      for section in self._parser.sections():      for section in self._parser.sections():
133        if section != 'mappings':        if section != 'mappings':
# Line 157  class GRFilterConfig: Line 161  class GRFilterConfig:
161    def getMappings(self):    def getMappings(self):
162      return tuple(self.mappings)      return tuple(self.mappings)
163    
   def getFilters(self):  
     return []  
164    
165      def getFilters(self, namespace=""):
166    
167        filters = []
168    
169        if namespace != "":
170          namespace += ':'
171    
172        for param in self.filters.keys():
173          if namespace == "" or param[:len(namespace)] == namespace:
174            filters.append((param,self.filters[param]))
175    
176        return filters
177    

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26