Re: [mapserver-users] Add a validation block using python mapscript
I'm not a mapscript expert, others may be able to help out better than me. try "LAYER VALIDATION .. .. .. END END" -- thomas On 14 January 2016 at 11:26, Andrea Periwrote: > Thx Thomas , > I find the right function name. > It is > updateFromString() > now the function is callable, but have another kind of error: > > Traceback (most recent call last): > File "generatore_mapfile_istat.py", line 192, in > theLayer.updateFromString(tempValidation) > File > "C:\my-programs\osgeo4w\apps\Python27\lib\site-packages\mapscript.py", li > ne 1568, in updateFromString > def updateFromString(self, *args): return > _mapscript.layerObj_updateFromStri > ng(self, *args) > EOFError: loadLayer(): Premature End-of-File. > > A. > > > 2016-01-14 11:18 GMT+01:00 thomas bonfort : > > mapscript is camelcase > > > > On 14 January 2016 at 10:51, Andrea Peri wrote: > >> > >> Hi Thomas, > >> Thx for reply, I don't know this sintax. > >> > >> I try this: > >> > >> theLayer = clone_map.getLayer(li) > >> tempValidation = "VALIDATION 'idtpn' '^[a-zA-Z0-9\-_#]+$' > >> 'default_idtpn' '%' END" > >> theLayer.updatefromstring(tempValidation) > >> > >> But it return an error: > >> > >> Traceback (most recent call last): > >> File "generatore_mapfile_istat.py", line 192, in > >> theLayer.updatefromstring(tempValidation) > >> File > >> "C:\my-programs\osgeo4w\apps\Python27\lib\site-packages\mapscript.py", > li > >> ne 1385, in > >> __getattr__ = lambda self, name: _swig_getattr(self, layerObj, name) > >> File > >> "C:\my-programs\osgeo4w\apps\Python27\lib\site-packages\mapscript.py", > li > >> ne 54, in _swig_getattr > >> raise AttributeError(name) > >> AttributeError: updatefromstring > >> > >> A. > >> > >> > >> 2016-01-14 10:38 GMT+01:00 thomas bonfort : > >> > if there is no mapscript interface for VALIDATION you can always use > >> > > >> > layer->updatefromstring("VALIDATION etc END") > >> > > >> > -- > >> > thomas > >> > > >> > On 14 January 2016 at 10:33, Andrea Peri wrote: > >> >> > >> >> Hi, > >> >> > >> >> Is possible , using the python mapscript add a block for validation > >> >> like > >> >> this ? > >> >> > >> >> VALIDATION > >> >> 'idtpn' '^[a-zA-Z0-9\-_#]+$' > >> >> 'default_idtpn' '%' > >> >> END > >> >> > >> >> > >> >> -- > >> >> - > >> >> Andrea Peri > >> >> . . . . . . . . . > >> >> qwerty àèìòù > >> >> - > >> >> ___ > >> >> mapserver-users mailing list > >> >> mapserver-users@lists.osgeo.org > >> >> http://lists.osgeo.org/mailman/listinfo/mapserver-users > >> > > >> > > >> > >> > >> > >> -- > >> - > >> Andrea Peri > >> . . . . . . . . . > >> qwerty àèìòù > >> - > > > > > > > > -- > - > Andrea Peri > . . . . . . . . . > qwerty àèìòù > - > ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] Add a validation block using python mapscript
Hi Thomas, Thx for reply, I don't know this sintax. I try this: theLayer = clone_map.getLayer(li) tempValidation = "VALIDATION 'idtpn' '^[a-zA-Z0-9\-_#]+$' 'default_idtpn' '%' END" theLayer.updatefromstring(tempValidation) But it return an error: Traceback (most recent call last): File "generatore_mapfile_istat.py", line 192, in theLayer.updatefromstring(tempValidation) File "C:\my-programs\osgeo4w\apps\Python27\lib\site-packages\mapscript.py", li ne 1385, in __getattr__ = lambda self, name: _swig_getattr(self, layerObj, name) File "C:\my-programs\osgeo4w\apps\Python27\lib\site-packages\mapscript.py", li ne 54, in _swig_getattr raise AttributeError(name) AttributeError: updatefromstring A. 2016-01-14 10:38 GMT+01:00 thomas bonfort: > if there is no mapscript interface for VALIDATION you can always use > > layer->updatefromstring("VALIDATION etc END") > > -- > thomas > > On 14 January 2016 at 10:33, Andrea Peri wrote: >> >> Hi, >> >> Is possible , using the python mapscript add a block for validation like >> this ? >> >> VALIDATION >> 'idtpn' '^[a-zA-Z0-9\-_#]+$' >> 'default_idtpn' '%' >> END >> >> >> -- >> - >> Andrea Peri >> . . . . . . . . . >> qwerty àèìòù >> - >> ___ >> mapserver-users mailing list >> mapserver-users@lists.osgeo.org >> http://lists.osgeo.org/mailman/listinfo/mapserver-users > > -- - Andrea Peri . . . . . . . . . qwerty àèìòù - ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] Add a validation block using python mapscript
mapscript is camelcase On 14 January 2016 at 10:51, Andrea Periwrote: > Hi Thomas, > Thx for reply, I don't know this sintax. > > I try this: > > theLayer = clone_map.getLayer(li) > tempValidation = "VALIDATION 'idtpn' '^[a-zA-Z0-9\-_#]+$' > 'default_idtpn' '%' END" > theLayer.updatefromstring(tempValidation) > > But it return an error: > > Traceback (most recent call last): > File "generatore_mapfile_istat.py", line 192, in > theLayer.updatefromstring(tempValidation) > File > "C:\my-programs\osgeo4w\apps\Python27\lib\site-packages\mapscript.py", li > ne 1385, in > __getattr__ = lambda self, name: _swig_getattr(self, layerObj, name) > File > "C:\my-programs\osgeo4w\apps\Python27\lib\site-packages\mapscript.py", li > ne 54, in _swig_getattr > raise AttributeError(name) > AttributeError: updatefromstring > > A. > > > 2016-01-14 10:38 GMT+01:00 thomas bonfort : > > if there is no mapscript interface for VALIDATION you can always use > > > > layer->updatefromstring("VALIDATION etc END") > > > > -- > > thomas > > > > On 14 January 2016 at 10:33, Andrea Peri wrote: > >> > >> Hi, > >> > >> Is possible , using the python mapscript add a block for validation like > >> this ? > >> > >> VALIDATION > >> 'idtpn' '^[a-zA-Z0-9\-_#]+$' > >> 'default_idtpn' '%' > >> END > >> > >> > >> -- > >> - > >> Andrea Peri > >> . . . . . . . . . > >> qwerty àèìòù > >> - > >> ___ > >> mapserver-users mailing list > >> mapserver-users@lists.osgeo.org > >> http://lists.osgeo.org/mailman/listinfo/mapserver-users > > > > > > > > -- > - > Andrea Peri > . . . . . . . . . > qwerty àèìòù > - > ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] Add a validation block using python mapscript
Hi, Is possible , using the python mapscript add a block for validation like this ? VALIDATION 'idtpn' '^[a-zA-Z0-9\-_#]+$' 'default_idtpn' '%' END -- - Andrea Peri . . . . . . . . . qwerty àèìòù - ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] Add a validation block using python mapscript
Thx Thomas , I find the right function name. It is updateFromString() now the function is callable, but have another kind of error: Traceback (most recent call last): File "generatore_mapfile_istat.py", line 192, in theLayer.updateFromString(tempValidation) File "C:\my-programs\osgeo4w\apps\Python27\lib\site-packages\mapscript.py", li ne 1568, in updateFromString def updateFromString(self, *args): return _mapscript.layerObj_updateFromStri ng(self, *args) EOFError: loadLayer(): Premature End-of-File. A. 2016-01-14 11:18 GMT+01:00 thomas bonfort: > mapscript is camelcase > > On 14 January 2016 at 10:51, Andrea Peri wrote: >> >> Hi Thomas, >> Thx for reply, I don't know this sintax. >> >> I try this: >> >> theLayer = clone_map.getLayer(li) >> tempValidation = "VALIDATION 'idtpn' '^[a-zA-Z0-9\-_#]+$' >> 'default_idtpn' '%' END" >> theLayer.updatefromstring(tempValidation) >> >> But it return an error: >> >> Traceback (most recent call last): >> File "generatore_mapfile_istat.py", line 192, in >> theLayer.updatefromstring(tempValidation) >> File >> "C:\my-programs\osgeo4w\apps\Python27\lib\site-packages\mapscript.py", li >> ne 1385, in >> __getattr__ = lambda self, name: _swig_getattr(self, layerObj, name) >> File >> "C:\my-programs\osgeo4w\apps\Python27\lib\site-packages\mapscript.py", li >> ne 54, in _swig_getattr >> raise AttributeError(name) >> AttributeError: updatefromstring >> >> A. >> >> >> 2016-01-14 10:38 GMT+01:00 thomas bonfort : >> > if there is no mapscript interface for VALIDATION you can always use >> > >> > layer->updatefromstring("VALIDATION etc END") >> > >> > -- >> > thomas >> > >> > On 14 January 2016 at 10:33, Andrea Peri wrote: >> >> >> >> Hi, >> >> >> >> Is possible , using the python mapscript add a block for validation >> >> like >> >> this ? >> >> >> >> VALIDATION >> >> 'idtpn' '^[a-zA-Z0-9\-_#]+$' >> >> 'default_idtpn' '%' >> >> END >> >> >> >> >> >> -- >> >> - >> >> Andrea Peri >> >> . . . . . . . . . >> >> qwerty àèìòù >> >> - >> >> ___ >> >> mapserver-users mailing list >> >> mapserver-users@lists.osgeo.org >> >> http://lists.osgeo.org/mailman/listinfo/mapserver-users >> > >> > >> >> >> >> -- >> - >> Andrea Peri >> . . . . . . . . . >> qwerty àèìòù >> - > > -- - Andrea Peri . . . . . . . . . qwerty àèìòù - ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users