[Qgis-developer] PluginBuilder writes a wrong import inside .py

2015-11-03 Thread Geo DrinX
Hello all,


probably you just know, but I found that "PluginBuilder"  plugin for QGIS
writes at line 26  of the main  .py  file the following code:


import resources


I think this is wrong,  because in run it returns a python error.


The correct code is:


import resources_rc


I hope this helps to create new and useful plugins .


Thank you in advance for attention

Roberto
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [Qgis-developer] PluginBuilder writes a wrong import inside .py

2015-11-03 Thread Anita Graser
On Tue, Nov 3, 2015 at 10:49 AM, Geo DrinX  wrote:

> Hello all,
>
>
> probably you just know, but I found that "PluginBuilder"  plugin for QGIS
> writes at line 26  of the main  .py  file the following code:
>
>
> import resources
>
>
> I think this is wrong,  because in run it returns a python error.
>
>
> The correct code is:
>
>
> import resources_rc
>

​Hi Roberto,
Afaik, the plugin builder code is not wrong. You just have to adjust the
name of the output file when compiling the resources.
Best wishes,
Anita​





>
>
> I hope this helps to create new and useful plugins .
>
>
> Thank you in advance for attention
>
> Roberto
>
> ___
> Qgis-developer mailing list
> Qgis-developer@lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/qgis-developer
>
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [Qgis-developer] PluginBuilder writes a wrong import inside .py

2015-11-03 Thread Richard Duivenvoorde
On 03-11-15 11:45, Anita Graser wrote:
> On Tue, Nov 3, 2015 at 10:49 AM, Geo DrinX  > wrote:
> 
> Hello all,
> 
> probably you just know, but I found that "PluginBuilder"  plugin for
> QGIS  writes at line 26  of the main  .py  file the following code:
> 
> import resources
> 
> I think this is wrong,  because in run it returns a python error.
> 
> The correct code is:
> 
> import resources_rc
> 
> ​Hi Roberto,
> Afaik, the plugin builder code is not wrong. You just have to adjust the
> name of the output file when compiling the resources.
> Best wishes,
> Anita​

Hi Roberto,

I've had this issue also some time ago, but according to Gary it should
be fixed:

https://github.com/g-sherman/Qgis-Plugin-Builder/issues/34

Note off course that plugins build with an older version of the builder
still will have the problem.
If you still have this problem with a current plugin, please report back
at the issuelist at Github

Regards,

Richard Duivenvoorde

___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [Qgis-developer] PluginBuilder writes a wrong import inside .py

2015-11-03 Thread Pirmin Kalberer
Hi Roberto,

Am Dienstag, 3. November 2015, 10.49:24 schrieb Geo DrinX:
> 
> 
> probably you just know, but I found that "PluginBuilder"  plugin for QGIS
> writes at line 26  of the main  .py  file the following code:
> 
> 
> import resources
> 
> 
> I think this is wrong,  because in run it returns a python error.
> 
> 
> The correct code is:
> 
> 
> import resources_rc
> 
> 
> I hope this helps to create new and useful plugins .

Please open an issue at
https://github.com/g-sherman/Qgis-Plugin-Builder

Regards
Pirmin

-- 
Pirmin Kalberer
Sourcepole  -  Linux & Open Source Solutions
http://www.sourcepole.com

___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [Qgis-developer] PluginBuilder writes a wrong import inside .py

2015-11-03 Thread Worth Lutz

This is not fixed.

Some background info:

http://gis.stackexchange.com/questions/139625/qgis-plugin-problems-importing-resources-resources-rc-file-plugin-doasnt-l/155599#155599

This is a problem with  "uic.loadUiType".

I have have determined that if you save your "ui" file in QT designer 
with the resources open after you have added a resource, you get this error.


This is because  QT designer adds

   
  
   

at the end of the file and this causes uic.loadUiType to look for a 
"resources_rc" as "_rc" is a default suffix.


I think closing the resource browser before saving the "ui" file in QT 
Designer will keep this added resources lines from being added to the 
end of the "ui" file.


*Worth Lutz*


On 11/3/2015 6:03 AM, Richard Duivenvoorde wrote:

On 03-11-15 11:45, Anita Graser wrote:

On Tue, Nov 3, 2015 at 10:49 AM, Geo DrinX mailto:geodr...@gmail.com>> wrote:

 Hello all,

 probably you just know, but I found that "PluginBuilder"  plugin for
 QGIS  writes at line 26  of the main  .py  file the following code:

 import resources

 I think this is wrong,  because in run it returns a python error.

 The correct code is:

 import resources_rc

​Hi Roberto,
Afaik, the plugin builder code is not wrong. You just have to adjust the
name of the output file when compiling the resources.
Best wishes,
Anita​

Hi Roberto,

I've had this issue also some time ago, but according to Gary it should
be fixed:

https://github.com/g-sherman/Qgis-Plugin-Builder/issues/34

Note off course that plugins build with an older version of the builder
still will have the problem.
If you still have this problem with a current plugin, please report back
at the issuelist at Github

Regards,

Richard Duivenvoorde

___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer


___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer