Re: [Qgis-developer] SIP API Update merged. Attention plugin authors

2013-06-14 Thread Giuseppe Sucameli
Hi Luigi (Gino), On Fri, Jun 14, 2013 at 12:00 AM, Gino Pirelli lui...@gmail.com wrote: returnCheck = true try: returnValue = variable except ValueError: returnCheck = false the previous code doesn't raise any ValueError without an explicit cast. If conversion goes wrong you

Re: [Qgis-developer] SIP API Update

2013-06-14 Thread Etienne Tourigny
I have done some more fixing of GdalTools. What remains are the algorithms in the Conversion and Analysis menus - most work left is tedious work changing QString-str and QStringList-list help and testing would be appreciated. Any volunteers? Etienne On Mon, Jun 3, 2013 at 6:14 PM, Etienne

Re: [Qgis-developer] SIP API Update merged. Attention plugin authors

2013-06-13 Thread Gino Pirelli
Hi I'm Luigi Pirelli I'm porting rt_mapserver_export to the new 2.0 SIP api I found another case where it's necessary to pay attention (and could be added in the wiki: http://hub.qgis.org/wiki/quantum-gis/Python_plugin_API_changes_from_18_to_20 as the case before about floats, a simple replace

Re: [Qgis-developer] SIP API Update merged. Attention plugin authors

2013-06-12 Thread Sandro Santilli
On Sun, Jun 09, 2013 at 10:27:51AM +0200, Borys Jurgiel wrote: Actually no breaking change happened now, there would be just MUCH more switches (assuming that e.g. each formerly QString-type variable may be either QString or unicode). So in the simplest plugins you can still use them and

Re: [Qgis-developer] SIP API Update merged. Attention plugin authors

2013-06-10 Thread Nathan Woodrow
Hey everyone, You are On Sat, Jun 8, 2013 at 9:35 PM, Nathan Woodrow madman...@gmail.com wrote: Hey all, The new SIP API has been merged now. There are still a few things to clean up in some of the core plugins but it is merged for wider testing. I don't expect to find any major issues.

[Qgis-developer] SIP API Update merged. Attention plugin authors and nightly dev users.

2013-06-10 Thread Nathan Woodrow
Hey everyone, You are now free to upload your new 2.0 API version of your plugins to the QGIS plugin repo. Remember to set qgisMinimumVersion and qgisMaximumVersion in your metadata.txt so that plugin repo and installer get the right version of the plugin. An updated conversion guide is at

Re: [Qgis-developer] SIP API Update merged. Attention plugin authors

2013-06-10 Thread Bernhard Ströbl
Nathan, bear with me I have a really basic question concerning you mail and advice [1]. I use quite a lot of QtSql.QSqlQuerys in my plugins to retrieve data from a PostgreSQL database. The value() method currently returns a QVariant. What is it supposed to return in the future or are only

Re: [Qgis-developer] SIP API Update merged. Attention plugin authors

2013-06-10 Thread Nathan Woodrow
Hey Bernhard, All PyQt functions are affected. QSqlQuery.Value will now return a native Python type. - Nathan On Mon, Jun 10, 2013 at 11:03 PM, Bernhard Ströbl bernhard.stro...@jena.dewrote: Nathan, bear with me I have a really basic question concerning you mail and advice [1]. I use

Re: [Qgis-developer] SIP API Update merged. Attention plugin authors

2013-06-10 Thread Radim Blazek
I am getting error on startup: An error occured during execution of following code: pyplugin_installer.instance().showPluginManagerWhenReady() ... url = settings.value(key+/url, , type=unicode) TypeError: QSettings.value(QString, QVariant defaultValue=QVariant()): 'type' is not a valid keyword

Re: [Qgis-developer] SIP API Update merged. Attention plugin authors and nightly dev users.

2013-06-10 Thread Borys Jurgiel
Dnia poniedziałek, 10 czerwca 2013 o 14:54:45 Nathan Woodrow napisał(a): Hey everyone, You are now free to upload your new 2.0 API version of your plugins to the QGIS plugin repo. Remember to set qgisMinimumVersion and qgisMaximumVersion in your metadata.txt so that plugin repo and installer

Re: [Qgis-developer] SIP API Update merged. Attention plugin authors

2013-06-10 Thread Matthias Kuhn
I have been working on a fix for this today, which is open as a pull request at the moment [1] We have been discussing this on IRC today, Main points: On the C++ side, there are invalid and NULL QVariants. On the python side there is only None, therefore QPyNullVariant has been introduced. As we

Re: [Qgis-developer] SIP API Update merged. Attention plugin authors

2013-06-09 Thread Richard Duivenvoorde
On 08-06-13 13:35, Nathan Woodrow wrote: Hey all, The new SIP API has been merged now. There are still a few things to clean up in some of the core plugins but it is merged for wider testing. I don't expect to find any major issues. Cool, THANKS! I would recommend creating a branch in

Re: [Qgis-developer] SIP API Update merged. Attention plugin authors

2013-06-09 Thread Borys Jurgiel
I would recommend creating a branch in git with your new 2.0 version and be ready to upload it when I give the go ahead. Is it not 'better' to branch your old version in the 1.8.x branch, and do further work in master (for future releases)? I believe Nathan meens to not upload the new

Re: [Qgis-developer] SIP API Update merged. Attention plugin authors

2013-06-09 Thread Nathan Woodrow
On Sun, Jun 9, 2013 at 6:27 PM, Borys Jurgiel li...@borysjurgiel.pl wrote: Actually no breaking change happened now, there would be just MUCH more switches (assuming that e.g. each formerly QString-type variable may be either QString or unicode). So in the simplest plugins you can still use

Re: [Qgis-developer] SIP API Update merged. Attention plugin authors

2013-06-09 Thread Richard Duivenvoorde
On 09-06-13 10:47, Nathan Woodrow wrote: Technically this can be done for smaller plugins like Borys said. Something like: I think only for VERY small plugins. In the (not so very big plugins) I do it was already getting messy. And by the why, a big thank you for all the great work and

Re: [Qgis-developer] SIP API Update merged. Attention plugin authors

2013-06-09 Thread Victor Olaya
I am checking the SEXTANTE adaptation to the new SIP API, and everything is fine. The only strange thing that I found is how null values are handled when they appear in a vector layer field. It seems that, in that case, a QVariant is still returned (particularly a QPyNullVariant object). Wouldn't

Re: [Qgis-developer] SIP API Update merged. Attention plugin authors

2013-06-09 Thread Nathan Woodrow
Victor, Which code is returning a QVariant null? - Nathan On Mon, Jun 10, 2013 at 12:01 AM, Victor Olaya vola...@gmail.com wrote: I am checking the SEXTANTE adaptation to the new SIP API, and everything is fine. The only strange thing that I found is how null values are handled when they

Re: [Qgis-developer] SIP API Update merged. Attention plugin authors

2013-06-09 Thread Matthias Kuhn
On Son 09 Jun 2013 16:02:57 CEST, Nathan Woodrow wrote: Victor, Which code is returning a QVariant null? feat['myAttribute'] returns QPyNullVariant for all features which have a NULL value in the field myAttribute. None would work for me as well. But I'm not sure, why PyQt introduced this

Re: [Qgis-developer] SIP API Update merged. Attention plugin authors

2013-06-09 Thread Nathan Woodrow
Ok I'll check it out and see if it can be converted. -- Nathan On Mon, Jun 10, 2013 at 12:19 AM, Matthias Kuhn matthias.k...@gmx.chwrote: On Son 09 Jun 2013 16:02:57 CEST, Nathan Woodrow wrote: Victor, Which code is returning a QVariant null? feat['myAttribute'] returns

Re: [Qgis-developer] SIP API Update merged. Attention plugin authors

2013-06-09 Thread Victor Olaya
I find that same behaviour that Matthias confirms. I guess it should be fixed, since it forces developers to add extra code to handle that case, and it can be very confusing (all other Qvariants are removed, except in this case...) Hopefully it will be easy to fix. Thanks in advance! Victor

Re: [Qgis-developer] SIP API Update merged. Attention plugin authors

2013-06-09 Thread Matthias Kuhn
Just found another case which requires special attention: Given a feature with myInt=5 Old API: feat['myInt'].toFloat() / 10 0.5 New API: feat['myInt'] / 10 0 Better: float( feat['myInt'] ) / 10 0.5 Or: feat['myInt'] / 10.0 0.5 I guess that's not something we can fix in a generic

Re: [Qgis-developer] SIP API Update merged. Attention plugin authors

2013-06-09 Thread Victor Olaya
I think it is a good idea to force the data type using str(), unicode(), int(), float(), etc... Maybe a bit redundant, but probably a safer strategy now 2013/6/9 Matthias Kuhn matthias.k...@gmx.ch: Just found another case which requires special attention: Given a feature with myInt=5 Old

Re: [Qgis-developer] SIP API Update merged. Attention plugin authors

2013-06-09 Thread Matthias Kuhn
And the NULL values? try: a = float(b['c']) except TypeError: a = None Do you have a more elegant idea? On Son 09 Jun 2013 16:46:42 CEST, Victor Olaya wrote: I think it is a good idea to force the data type using str(), unicode(), int(), float(), etc... Maybe a bit redundant, but

Re: [Qgis-developer] SIP API Update merged. Attention plugin

2013-06-09 Thread Nathan Woodrow
From: Matthias Kuhn Sent: 10/06/2013 12:42 AM To: Victor Olaya Cc: Richard Duivenvoorde; qgis-developer@lists.osgeo.org; Nathan Woodrow Subject: Re: [Qgis-developer] SIP API Update merged. Attention plugin authors Just found another case which requires special attention: Given a feature with myInt=5

[Qgis-developer] SIP API Update merged. Attention plugin authors

2013-06-08 Thread Nathan Woodrow
Hey all, The new SIP API has been merged now. There are still a few things to clean up in some of the core plugins but it is merged for wider testing. I don't expect to find any major issues. I have written a conversion guide here: https://gist.github.com/NathanW2/5734767 Plugin authors

Re: [Qgis-developer] SIP API Update

2013-06-06 Thread Nathan Woodrow
Hey all, Would I be able to get an update on where everyone is at with updating the core plugins. I have started updating the plugin installer and should have that done tomorrow. - Nathan On Wed, Jun 5, 2013 at 7:09 AM, Etienne Tourigny etourigny@gmail.comwrote: On Tue, Jun 4, 2013 at

Re: [Qgis-developer] SIP API Update

2013-06-06 Thread Alexander Bruy
Hi Nathan, fTools part is mostly done, but unfortunatelly I have to time for intensive testing, so maybe there are some minor issues. 2013/6/6 Nathan Woodrow madman...@gmail.com: Hey all, Would I be able to get an update on where everyone is at with updating the core plugins. I have started

Re: [Qgis-developer] SIP API Update

2013-06-06 Thread Victor Olaya
Nathan Same here for SEXTANTE. You already merged the PR I made, but there might be still some issues. I think that, anyway, the new SIP API branch it should be merged into master so users can test, and I will be ready for fixing all issues ASAP if they appear. thanks again for you great work!

Re: [Qgis-developer] SIP API Update

2013-06-06 Thread Etienne Tourigny
On Thu, Jun 6, 2013 at 9:46 AM, Nathan Woodrow madman...@gmail.com wrote: Hey all, Would I be able to get an update on where everyone is at with updating the core plugins. I have started updating the plugin installer and should have that done tomorrow. I have fixed a few of the GdalTools

Re: [Qgis-developer] SIP API Update

2013-06-04 Thread Borys Jurgiel
Of course only the new one will be upgraded :) Dnia wtorek, 4 czerwca 2013 o 07:25:24 Alexander Bruy napisał(a): Maybe I'm wrong, bit there is no sense to upgrade Plugin installer as it will be replaced by new one ___ Qgis-developer mailing list

Re: [Qgis-developer] SIP API Update

2013-06-04 Thread Etienne Tourigny
I just ran into another problem... how do you pass a list (of strings) to a QT function which requires a QStringList (which is not available anymore). File /home/softdev/share/qgis/python/plugins/GdalTools/tools/GdalTools_utils.py, line 208, in getRasterFiles workDir.setNameFilters( filter )

Re: [Qgis-developer] SIP API Update

2013-06-04 Thread Etienne Tourigny
How do we handle translated strings with arguments? QString::arg() is not available. Not sure if the following would work? The string syntax is slightly different and would require re-translation, but at least works in English before: self.tr( %1 not created. ).arg( outFn ) after: self.tr( %s

Re: [Qgis-developer] SIP API Update

2013-06-04 Thread Etienne Tourigny
On Tue, Jun 4, 2013 at 3:40 PM, Etienne Tourigny etourigny@gmail.comwrote: I just ran into another problem... how do you pass a list (of strings) to a QT function which requires a QStringList (which is not available anymore). File

Re: [Qgis-developer] SIP API Update

2013-06-03 Thread Etienne Tourigny
The following core plugins do not load properly: plugin_installer GdalTools Do the respective devs plan to fix this? I could help out a bit with GdalTools, but I don't know anything about the plugin_installer plugin to really help. Cheers Etienne On Thu, May 30, 2013 at 3:12 AM, Nathan Woodrow

Re: [Qgis-developer] SIP API Update

2013-06-03 Thread Borys Jurgiel
Dnia poniedziałek, 3 czerwca 2013 o 23:14:26 Etienne Tourigny napisał(a): The following core plugins do not load properly: plugin_installer GdalTools Do the respective devs plan to fix this? I could help out a bit with GdalTools, but I don't know anything about the plugin_installer plugin

Re: [Qgis-developer] SIP API Update

2013-06-03 Thread Nathan Woodrow
Yeah Borys or myself will take care of the plugin installer. Marco is going to review the C++ part of the installer and merge that into master. Once that is done I will merge SIP v2 into master and update the plugin installer. Matthias has a patch that he started for gdal tools. I'm going to

Re: [Qgis-developer] SIP API Update

2013-06-03 Thread Etienne Tourigny
On Mon, Jun 3, 2013 at 7:51 PM, Nathan Woodrow madman...@gmail.com wrote: Yeah Borys or myself will take care of the plugin installer. Marco is going to review the C++ part of the installer and merge that into master. Once that is done I will merge SIP v2 into master and update the plugin

Re: [Qgis-developer] SIP API Update

2013-06-03 Thread Nathan Woodrow
Ok patch for gdaltools applied. Thanks Matthias. Can I get some testing on that. Regards, Nathan On Tue, Jun 4, 2013 at 9:24 AM, Etienne Tourigny etourigny@gmail.comwrote: On Mon, Jun 3, 2013 at 7:51 PM, Nathan Woodrow madman...@gmail.comwrote: Yeah Borys or myself will take care of

Re: [Qgis-developer] SIP API Update

2013-06-03 Thread Etienne Tourigny
I've pushed some fixes for info and clipper. the raster file dialog filters needs fixing On Mon, Jun 3, 2013 at 8:31 PM, Nathan Woodrow madman...@gmail.com wrote: Ok patch for gdaltools applied. Thanks Matthias. Can I get some testing on that. Regards, Nathan On Tue, Jun 4, 2013 at 9:24

Re: [Qgis-developer] SIP API Update

2013-06-03 Thread Alexander Bruy
Maybe I'm wrong, bit there is no sense to upgrade Plugin installer as it will be replaced by new one 2013/6/4 Etienne Tourigny etourigny@gmail.com: The following core plugins do not load properly: plugin_installer GdalTools Do the respective devs plan to fix this? I could help out a bit

Re: [Qgis-developer] SIP API Update

2013-06-03 Thread Paolo Cavallini
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Il 04/06/2013 07:45, Mathieu Pellerin ha scritto: Does the georeferencing plugin requires porting to new SIP version? If so it should be put on radar asap, that's a pretty fundamental function. it's a C++ plugin. thanks. - -- Paolo Cavallini -

Re: [Qgis-developer] SIP API Update

2013-06-03 Thread Nathan Woodrow
No. Only Python plugins need updating. - Nathan On Tue, Jun 4, 2013 at 3:45 PM, Mathieu Pellerin nirvn.a...@gmail.comwrote: Does the georeferencing plugin requires porting to new SIP version? If so it should be put on radar asap, that's a pretty fundamental function. On 4 Jun 2013 12:25,

[Qgis-developer] SIP API Update

2013-05-30 Thread Nathan Woodrow
Hey all, I have decided to manage the SIP API update process so that we can have it done by 2.0. This is an important update as leaving it for later will break every plugin yet again at later date which just leaves a really bad taste for people to deal with. A few plugin authors have already

Re: [Qgis-developer] SIP API Update

2013-05-30 Thread Matthias Kuhn
Thank you Nathan, Great to see somebody tackle this task. I sent a preliminary patch for gdaltools to the list a couple of days ago. I don't know if it helps and it sure is buggy, but whoever is going to upgrade this plugin could have a look. It's attached again here for convenience. Matthias

Re: [Qgis-developer] SIP API Update

2013-05-30 Thread Jo
2013/5/30 Sandro Santilli s...@keybit.net On Thu, May 30, 2013 at 04:12:15PM +1000, Nathan Woodrow wrote: If you are not aware of what benefits the SIP API update will bring here is a quick example: Before: str(yourlineedit.text().toString()) 'Hello World'

Re: [Qgis-developer] SIP API Update

2013-05-30 Thread Matthias Kuhn
On Don 30 Mai 2013 11:04:18 CEST, Sandro Santilli wrote: On Thu, May 30, 2013 at 04:12:15PM +1000, Nathan Woodrow wrote: If you are not aware of what benefits the SIP API update will bring here is a quick example: Before: str(yourlineedit.text().toString()) 'Hello World'

Re: [Qgis-developer] SIP API Update

2013-05-30 Thread Nathan Woodrow
The old way e.g toInt()[0] will not work anymore hence why we have to update everything. The 1000 is a typo. - Nathan On Thu, May 30, 2013 at 7:07 PM, Jo winfi...@gmail.com wrote: 2013/5/30 Sandro Santilli s...@keybit.net On Thu, May 30, 2013 at 04:12:15PM +1000, Nathan Woodrow wrote:

Re: [Qgis-developer] SIP API Update

2013-05-30 Thread Nathan Woodrow
*. Sent from some fancy phone looking thingo From: Matthias Kuhn Sent: 30/05/2013 7:10 PM To: Sandro Santilli Cc: qgis-developer@lists.osgeo.org; Nathan Woodrow Subject: Re: [Qgis-developer] SIP API Update On Don 30 Mai 2013 11:04:18 CEST, Sandro Santilli wrote: On Thu, May 30, 2013 at 04:12:15PM

Re: [Qgis-developer] SIP API Update

2013-05-30 Thread Nathan Woodrow
: [Qgis-developer] SIP API Update On Don 30 Mai 2013 11:04:18 CEST, Sandro Santilli wrote: On Thu, May 30, 2013 at 04:12:15PM +1000, Nathan Woodrow wrote: If you are not aware of what benefits the SIP API update will bring here is a quick example: Before: str(yourlineedit.text

Re: [Qgis-developer] SIP API Update

2013-05-30 Thread Etienne Tourigny
so plugin authors would potentially need to maintain 2 versions of their plugins, on for qgis = 1.8 and one for qgis =2.0. This is probably easier than adding a bunch of if statements where sip1 and spi2 need different syntax I guess, cheers Etienne On Thu, May 30, 2013 at 6:07 AM, Nathan

Re: [Qgis-developer] SIP API Update

2013-05-30 Thread Etienne Tourigny
On Thu, May 30, 2013 at 3:12 AM, Nathan Woodrow madman...@gmail.com wrote: Hey all, I have decided to manage the SIP API update process so that we can have it done by 2.0. This is an important update as leaving it for later will break every plugin yet again at later date which just leaves a

Re: [Qgis-developer] SIP API Update

2013-05-30 Thread Nathan Woodrow
Etienne, If self.attrStr() is something like QVariant(value) then you need to remove the QVariant() bit call. - Nathan On Fri, May 31, 2013 at 12:39 PM, Nathan Woodrow madman...@gmail.comwrote: Yeah they both return QVariant but that is auto converted to a Python object by SIP. Not sure

Re: [Qgis-developer] SIP API Update

2013-05-30 Thread Nathan Woodrow
Etienne, Basically QVariant no longer exits in PyQt so if you have from PyQt4.QtCore import QVariant you can remove it, or if you have: myvalue = QVariant(10) change it to myvalue = 10. - Nathan On Fri, May 31, 2013 at 12:41 PM, Nathan Woodrow madman...@gmail.comwrote: Etienne, If

Re: [Qgis-developer] SIP API Update

2013-05-30 Thread Etienne Tourigny
On Thu, May 30, 2013 at 11:41 PM, Nathan Woodrow madman...@gmail.comwrote: Etienne, If self.attrStr() is something like QVariant(value) then you need to remove the QVariant() bit call. that probably was the problem, it works now, many thanks. - Nathan On Fri, May 31, 2013 at 12:39