Re: [Qgis-developer] translate shortcuts

2015-09-08 Thread Richard Duivenvoorde
On 07-09-15 16:50, jawensi wrote:
> Hello.
> 
> I want to translate a menu name which has a shortcuts when Alt key is
> pressed. 
> 
> /self.templMenu.setTitle(self.tr('&Templates'))/
> 
> The letter of shortcuts is defined with symbol '&'. In my example the menu
> name is 'templates' and when 'Alt + t' is pressed the menu is opened.
> 
> When I write the 'my_plugin_es.ts' file to translate it and then compile to
> 'my_plugin_es.qm', it desn't work. Any idea how I have to write the menu
> name in the 'my_plugin_es.ts' file?

Have a look in the 'QGIS plugin builder'-plugin sources or in it's
makefile. I had that one working with translations some time ago.

Regards,

Richard

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


Re: [Qgis-developer] translate shortcuts

2015-09-08 Thread jawensi
Hello,

Finally I defined first the text and then I added to the name menu. Now it
works

/text = self.tr('Templates')
self.templMenu.setTitle('&' + text) /

'my_plugin_es.ts' looks like:

/

Templates
Plantillas
/

In English the shortcut works pressing 'Alt + t', and in Spanish the
shortcut works now pressing 'Alt + p'

thanks



--
View this message in context: 
http://osgeo-org.1560.x6.nabble.com/translate-shortcuts-tp5222943p5223077.html
Sent from the Quantum GIS - Developer mailing list archive at Nabble.com.
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer


[Qgis-developer] Deliberate errors, but Travis passes

2015-09-08 Thread Tom Chadwin
I've implemented very basic Travis testing for the plugin qgis2web, and it's
been working very well, catching code errors which result in Python errors.
However, I'm now trying to expand the suite of tests to test the plugin
against different data. The problem I have is that I now cannot get Travis
to fail a build. I have tried adding deliberate errors which cause Python
errors when running the plugin, but Travis still passes.

The file with the tests is:

https://github.com/tomchadwin/qgis2web/blob/master/test/test_qgis2web_dialog.py

Can anyone help?



--
View this message in context: 
http://osgeo-org.1560.x6.nabble.com/Deliberate-errors-but-Travis-passes-tp5223114.html
Sent from the Quantum GIS - Developer mailing list archive at Nabble.com.
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer


[Qgis-developer] What's your view on QGIS plugins that connect to non-GPL software?

2015-09-08 Thread Crispin Cooper
Hi qgis-developers,

I produce my own network analysis software sDNA 
(www.cardiff.ac.uk/sdna).  It currently runs as 
a plugin for ArcGIS or Autocad, from the command line, with a standalone GUI, 
or through a Python API.

We would like to create a QGIS plugin that allows people to use sDNA from 
inside QGIS.  sDNA is free but not open source, still I believe this can be 
done within the terms of the GPL by running sDNA in a separate process with 
pipe or file communication.  That said, I'd like to know whether a plugin that 
loosely connects to proprietary software would be welcome in the first place.

What are your thoughts?

Best regards

Crispin

--
Dr Crispin Cooper
Sustainable Places Research Institute, Cardiff University
33 Park Place, Cardiff CF10 3BA
Tel. +44 (0) 29 2087 6072 / ext. 76072

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

Re: [Qgis-developer] Deliberate errors, but Travis passes

2015-09-08 Thread Matthias Kuhn
Hi Tom,

I mostly use the normal assert or one of its unittest twins
https://docs.python.org/2/library/unittest.html#assert-methods to
compare calculated results against expected results.
I didn't find any of these in your file, so I am not sure, what exactly
should trigger a test failure there.

Matthias


On 09/08/2015 02:09 PM, Tom Chadwin wrote:
> I've implemented very basic Travis testing for the plugin qgis2web, and it's
> been working very well, catching code errors which result in Python errors.
> However, I'm now trying to expand the suite of tests to test the plugin
> against different data. The problem I have is that I now cannot get Travis
> to fail a build. I have tried adding deliberate errors which cause Python
> errors when running the plugin, but Travis still passes.
>
> The file with the tests is:
>
> https://github.com/tomchadwin/qgis2web/blob/master/test/test_qgis2web_dialog.py
>
> Can anyone help?
>
>
>
> --
> View this message in context: 
> http://osgeo-org.1560.x6.nabble.com/Deliberate-errors-but-Travis-passes-tp5223114.html
> Sent from the Quantum GIS - Developer mailing list archive at Nabble.com.
> ___
> Qgis-developer mailing list
> Qgis-developer@lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/qgis-developer




signature.asc
Description: OpenPGP digital signature
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [Qgis-developer] What's your view on QGIS plugins that connect to non-GPL software?

2015-09-08 Thread Vincent Picavet (ml)
Hello Crispin,

On 08/09/2015 14:10, Crispin Cooper wrote:
> Hi qgis-developers,
> I produce my own network analysis software sDNA (www.cardiff.ac.uk/sdna
> ).  It currently runs as a plugin for
> ArcGIS or Autocad, from the command line, with a standalone GUI, or
> through a Python API. 
> We would like to create a QGIS plugin that allows people to use sDNA
> from inside QGIS.  sDNA is free but not open source, still I believe
> this can be done within the terms of the GPL by running sDNA in a
> separate process with pipe or file communication.  That said, I’d like
> to know whether a plugin that loosely connects to proprietary software
> would be welcome in the first place.

Some (almost 100%) sure things :
* a Python "import" means GPL "contamination"
* Calling an external process communicating through pipe or file does
not imply GPL contamination

I would say that it is safe to have a qgis plugin calling a proprietary
external process.
That said, I also think that your external process should not be a
necessary part to run your software, otherwise it may be considered as a
strong connection or inclusion, and be subject to GPL contamination. If
it is optional, no problem. This specific point has to be verified
though, not 100% sure.

Vincent
> 
>  
> 
> What are your thoughts?
> 
>  
> 
> Best regards
> 
>  
> 
> Crispin
> 
>  
> 
> -- 
> 
> Dr Crispin Cooper
> 
> Sustainable Places Research Institute, Cardiff University
> 
> 33 Park Place, Cardiff CF10 3BA
> 
> Tel. +44 (0) 29 2087 6072 / ext. 76072
> 
>  
> 
> 
> 
> ___
> 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] Deliberate errors, but Travis passes

2015-09-08 Thread Tom Chadwin
Hi Matthias

This is the very early stages of implementing unittest. In time, I will test
for expected results using assert methods. At the moment, though, all I want
this to achieve is to catch Python errors, to prevent my making releases
which crash. This is what I was doing before, and it worked as I needed: if
the plugin gave a Python error, Travis failed - if not, it passed. This no
longer seems to work, though - as I say, if I introduce a deliberate error
to the code, and confirm that the plugin gives a Python error, Travis
nevertheless passes.

Thanks

Tom



--
View this message in context: 
http://osgeo-org.1560.x6.nabble.com/Deliberate-errors-but-Travis-passes-tp5223114p5223142.html
Sent from the Quantum GIS - Developer mailing list archive at Nabble.com.
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer


Re: [Qgis-developer] Deliberate errors, but Travis passes

2015-09-08 Thread Matthias Kuhn
Hi Tom,

In this case please read my question as "where exactly do you expect the
tests to fail?" :-)

I did a short check and it looks like it causes a segfault at the moment
and this is somehow not picked up properly?

Though looking at your commit for the deliberate error you are looking
for an exception but it is unclear to me via which codepath the tests
should get from the test file to the point in the code where you
introduced the deliberate error.

Matthias

On 09/08/2015 03:36 PM, Tom Chadwin wrote:
> Hi Matthias
>
> This is the very early stages of implementing unittest. In time, I will test
> for expected results using assert methods. At the moment, though, all I want
> this to achieve is to catch Python errors, to prevent my making releases
> which crash. This is what I was doing before, and it worked as I needed: if
> the plugin gave a Python error, Travis failed - if not, it passed. This no
> longer seems to work, though - as I say, if I introduce a deliberate error
> to the code, and confirm that the plugin gives a Python error, Travis
> nevertheless passes.
>
> Thanks
>
> Tom
>
>
>
> --
> View this message in context: 
> http://osgeo-org.1560.x6.nabble.com/Deliberate-errors-but-Travis-passes-tp5223114p5223142.html
> Sent from the Quantum GIS - Developer mailing list archive at Nabble.com.
> ___
> Qgis-developer mailing list
> Qgis-developer@lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/qgis-developer




signature.asc
Description: OpenPGP digital signature
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [Qgis-developer] Deliberate errors, but Travis passes

2015-09-08 Thread Tom Chadwin
Hi Matthias

Firstly, I'm not aware of a current segfault in the tests, so I'll keep an
eye out for that.

Yes, I am talking about exceptions thrown by Python. The deliberate error I
have introduced is in the main function called when a map is exported in
Leaflet format (ie not in Openlayers3). This means that about half of the
tests should fail (the ones with Leaflet in the function name). However,
they all pass for me.

Thanks

Tom



--
View this message in context: 
http://osgeo-org.1560.x6.nabble.com/Deliberate-errors-but-Travis-passes-tp5223114p5223178.html
Sent from the Quantum GIS - Developer mailing list archive at Nabble.com.
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer