Re: [josm-dev] How to use DownloadTask in Python/Jython

2015-01-18 Thread Jo
Hi Paul, Many thanks for your help. Unfortunately I gave up on trying to get it to work. So I rewrote the script in such a way that the user can decide to download data and if they do, then the script will terminate and they'll have to run it once again, so it can perform the rest of the work. (Co

Re: [josm-dev] How to use DownloadTask in Python/Jython

2015-01-17 Thread Jo
Oh, I've been debugging for the past hour and preparing the message which crossed yours. In the mean time I had come to the conclusion it'd be best to include the bounds in the Overpass, but I hadn't gotten around to it yet. I'm going to look into running it with another background thread. Thanks

Re: [josm-dev] How to use DownloadTask in Python/Jython

2015-01-17 Thread Jo
f.get() doesn't do the trick. As long as my Python code is running in the scripting plugin, the download occurs correctly but the downloaded data is not arriving somehow. Or some thread is not released. I'm not sure. I created some loops and I see the data coming in, but the loop never terminates.

Re: [josm-dev] How to use DownloadTask in Python/Jython

2015-01-17 Thread Paul Hartmann
On 17.01.2015 00:27, Jo wrote: Hi Paul, Many thanks for your help. f.get() makes the script hang forever. Maybe the script and the download are run by the same Executor (Main.worker). Then this would block. You can try to run your entire script in a new background thread. (Code example: htt

Re: [josm-dev] How to use DownloadTask in Python/Jython

2015-01-16 Thread Jo
Hi Paul, Many thanks for your help. f.get() makes the script hang forever. When I don't add it the download works correctly. At least, once I cleaned up the Overpass Query. This is where I am now (# means comment and shows all the other stuff I tried). At the moment the query runs and the downlo

Re: [josm-dev] How to use DownloadTask in Python/Jython

2015-01-16 Thread Paul Hartmann
On 16.01.2015 14:23, Jo wrote: Hi guys, Unfortunately I'm not smart enough to code in Java, so I use Python in the scripting plugin, which gets me quite far, but now I'm stuck: [...] dt = DownloadOsmTask() dt.loadUrl(False, 'http://overpass-api.de/api/interpreter?data=' + ove

[josm-dev] How to use DownloadTask in Python/Jython

2015-01-16 Thread Jo
Hi guys, Unfortunately I'm not smart enough to code in Java, so I use Python in the scripting plugin, which gets me quite far, but now I'm stuck: import org.openstreetmap.josm.gui.dialogs.relation.DownloadRelationMemberTask as DownloadRelationMemberTask import org.openstreetmap.josm.actions.Downl