27 |
# NOTES: |
# NOTES: |
28 |
# |
# |
29 |
|
|
30 |
import sys, string, os, os.path, re |
import sys, string, os, os.path, re, types |
31 |
from gnue.common.definitions import GObjects |
from gnue.common.definitions import GObjects |
32 |
from gnue.common.apps import GDebug, GConfig |
from gnue.common.apps import GDebug, GConfig |
33 |
from gnue.common.datasources import GDataSource |
from gnue.common.datasources import GDataSource |
106 |
'skipThisRow':{'function':self.triggerSkipRow, |
'skipThisRow':{'function':self.triggerSkipRow, |
107 |
'global':0} |
'global':0} |
108 |
} |
} |
109 |
|
|
110 |
|
# self._triggerProperties = {'extensions':{'get':self.getTriggerExtensions, |
111 |
|
# 'set':self.setTriggerExtensions}} |
112 |
|
|
113 |
def triggerSetValue(self,field,value): |
def triggerSetValue(self,field,value): |
114 |
self.valuesetbytrigger[field]=value |
self.valuesetbytrigger[field]=value |
308 |
inpCount=1 |
inpCount=1 |
309 |
out=self.mergemask |
out=self.mergemask |
310 |
for child in self._children: |
for child in self._children: |
311 |
if child.type=="src": |
if child.type=="src": |
312 |
value=str(row.getField(child.name)) |
value=row.getField(child.name) |
313 |
|
if type(value)!=types.StringType and type(value)!=types.UnicodeType: |
314 |
|
value=str(value) |
315 |
if child.trim: |
if child.trim: |
316 |
value=string.strip(value) |
value=string.strip(value) |
317 |
out=string.replace(out,'@%s' % inpCount, '%s' % value) |
out=string.replace(out,'@%s' % inpCount, '%s' % value) |
318 |
inpCount+=1 |
inpCount+=1 |
319 |
|
|
320 |
# print row.getField(child.name),' ', |
# print row.getField(child.name),' ', |
321 |
|
|
322 |
if hasattr(self,"splitre"): |
if hasattr(self,"splitre"): |
345 |
def __init__(self, parent): |
def __init__(self, parent): |
346 |
GIObject.__init__(self, parent, type="GIField") |
GIObject.__init__(self, parent, type="GIField") |
347 |
self._inits = [self.initialize] |
self._inits = [self.initialize] |
348 |
|
|
349 |
|
# TODO: add get/set procs |
350 |
|
|
351 |
def initialize(self): |
def initialize(self): |
352 |
self._mappings = self.findParentOfType('GIMappings') |
self._mappings = self.findParentOfType('GIMappings') |