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 |
|
|
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 |
|
|
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 |
|
|
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': |
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 |
|
|