Re: [QGIS-Developer] Retrieve folder path from Processing scripts

2018-05-30 Thread matteo
Awesome!

Many many thanks Nyalll

Cheers

Matteo
___
QGIS-Developer mailing list
QGIS-Developer@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [QGIS-Developer] Retrieve folder path from Processing scripts

2018-05-29 Thread Nyall Dawson
On 30 May 2018 at 04:03, matteo  wrote:
> Hi Nyall,
>
> here it is:
>
> https://www.dropbox.com/s/bpu1axmrpnjyn2n/folder.mp4?dl=0
>
> thanks for taking care of this small issue

Thanks - confirmed and fixed in https://github.com/qgis/QGIS/commit/d157b6e66173

Nyall
___
QGIS-Developer mailing list
QGIS-Developer@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [QGIS-Developer] Retrieve folder path from Processing scripts

2018-05-29 Thread matteo
Hi Nyall,

here it is:

https://www.dropbox.com/s/bpu1axmrpnjyn2n/folder.mp4?dl=0

thanks for taking care of this small issue

Cheers

Matteo
___
QGIS-Developer mailing list
QGIS-Developer@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [QGIS-Developer] Retrieve folder path from Processing scripts

2018-05-29 Thread Nyall Dawson
On 29 May 2018 at 21:23, matteo  wrote:
> Hi Nyall,
>
> I'm on a Linux Debian Sid with QGIS master compiled.
>
> I nobody has the same issue then there should be something on my local
> machine and that's fine since I know the small workaround ;)
>
> but still weird
>
> Thanks for the reply

Maybe a short screencast would help me know if I'm following the same
steps you are?

Nyall

>
> Matteo
___
QGIS-Developer mailing list
QGIS-Developer@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [QGIS-Developer] Retrieve folder path from Processing scripts

2018-05-29 Thread matteo
Hi Nyall,

I'm on a Linux Debian Sid with QGIS master compiled.

I nobody has the same issue then there should be something on my local
machine and that's fine since I know the small workaround ;)

but still weird

Thanks for the reply

Matteo
___
QGIS-Developer mailing list
QGIS-Developer@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [QGIS-Developer] Retrieve folder path from Processing scripts

2018-05-29 Thread Nyall Dawson
On 29 May 2018 at 18:08, matteo  wrote:
> Hi devs,
>
> fighting with this problem I might have found a small bug (if someone
> can confirm this).
>
> So with `QgsProcessingParameterFolderDestination` and
> `parameterAsString` Processing takes the path only if the path is added
> manually OR if the user choose the path from the button BUT types
> something in the box.
>
> If the path is taken directly from the button I always get a temporary path
>
> If someone wants to give a try I have prepared a copy/paste script for
> testing here:
>
> https://pastebin.com/DEHvD0nr
>
> If confirmed I can open a ticket

I can't confirm - what platform are you seeing this on?

Nyall

>
> Thanks
>
> Matteo
> ___
> QGIS-Developer mailing list
> QGIS-Developer@lists.osgeo.org
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
___
QGIS-Developer mailing list
QGIS-Developer@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [QGIS-Developer] Retrieve folder path from Processing scripts

2018-05-29 Thread matteo
Hi devs,

fighting with this problem I might have found a small bug (if someone
can confirm this).

So with `QgsProcessingParameterFolderDestination` and
`parameterAsString` Processing takes the path only if the path is added
manually OR if the user choose the path from the button BUT types
something in the box.

If the path is taken directly from the button I always get a temporary path

If someone wants to give a try I have prepared a copy/paste script for
testing here:

https://pastebin.com/DEHvD0nr

If confirmed I can open a ticket

Thanks

Matteo
___
QGIS-Developer mailing list
QGIS-Developer@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer

[QGIS-Developer] Retrieve folder path from Processing scripts

2018-05-28 Thread matteo
Hi devs,

I don't know if I'm facing a bug or if I'm missing something. In a
Processing script (or Processing plugin, same same) I cannot not get the
path of the folder when the folder is a Processing parameter:

...
NAME = 'NAME'
FOLDER = 'FOLDER'
...
self.addParameter(QgsProcessingParameterString(
self.NAME,
self.tr('My name')))

self.addParameter(QgsProcessingParameterFolderDestination(
self.FOLDER,
self.tr('Output folder')))
...
baseName = self.parameterAsString(parameters, self.NAME, context)
directory = self.parameterAsString(parameters, self.FOLDER, context)
basePath = os.path.join(directory, baseName)
feedback.pushDebugInfo(basePath)
return {self.FOLDER: basePath}


I always get a temporary path even when the user choose a folder on the
computer.

Someone else faced this problem?

Thanks for any suggestion!

Matteo
___
QGIS-Developer mailing list
QGIS-Developer@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer