-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Thanks Anne,
This sounds like a plan. Andreas On 12/11/2011 06:12 PM, Anne Ghisla wrote: > On Sun, 11 Dec 2011 15:26:55 +0100 Andreas Neumann > <[email protected]> wrote: > >> in javascript there is try and catch for such problems. Ore one >> could test if an object/method/property is present. There are a >> lot of browser differencies - so in a web environment it is quite >> normal to test for capabilities. >> >> How can one check if an object/method is present in Python? > > Hello Andreas, all, > > the check can be done during import: > > """ try: from qgis.core import newFunctionName as function except: > from qgis.core import oldFunctionName as function """ > > so that you can use "function" anywhere in the code without > further checks. To keep the import code short, only the previous > version of the API is tested. If a plugin developer wants to extend > support to even older versions, I would recommend to create a > separate "LTS" version. What do you think? > > Anne > > > > _______________________________________________ Qgis-developer > mailing list [email protected] > http://lists.osgeo.org/mailman/listinfo/qgis-developer -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQEcBAEBAgAGBQJO5O3tAAoJELiCsGDopvBCrAwH/2ydwarWM9Gl2fInHmtTb/ZA NlFFLKnBozPljo4DM+vgV4Uluxx2FfygPSF1uf+7eBfUcBgZLXAW+3WaPLornze5 Jubk1i4PAMdxCH51+LvYQHFJEpSnjc8ueS7HZLv5ZuleE0IR9AuhQnnWIPhz4NKT 2ubCKE192+HILbmecGIxFHDgjO04WByvxSrOR8R617ZldZn4fwttADu+6K9Ukyu5 bfF6veU47TsN2gbttsGZphgZ/yqw0gKEYoCQUds3xvvHQvuKIwz+9CKeP5Go7nSe 5om77gP03O3Fu5K86bRHbk/dNMz14GeWKTp9Z7qos9qJ2W5toKGG5D9H5XqCWIM= =44J+ -----END PGP SIGNATURE----- _______________________________________________ Qgis-developer mailing list [email protected] http://lists.osgeo.org/mailman/listinfo/qgis-developer
