'download_url' is not defined for suntime library

Hi everyone,

yesterday I pushed a new library suntime. I can find it in Zerynth Studio’s Library Manager, but, if I try to install it, I get the following:

[info] Downloading https://github.com/lorcap/zerynth-suntime/archive/r1.0.1.tar.gz
[warning] Can't install lib.lorcap.zerynth-suntime name 'download_url' is not defined

The URL works if cut-and-pasted into a web browser. Did I miss anything when publishing the library?

Hi @lorcap,

thanks for your feedback and also for all the contributions on our github (excellent code, we will try to include it in the official stdlib in the next release).

Regarding the issue you are having, we’ll get back to you as soon as we can reproduce the problem. In the meantime, an ugly hack, is to copy your lib under ~/.zerynth2/dist//libs/official and import it as an official Zerynth lib

Thanks for you reply. Indeed, I did:

ln -s ~/git/zerynth/suntime ~/.zerynth2/dist//libs/lorcap/suntime

I noticed I get the same warning when issuing:

ztc package install lib.lorcap.zerynth-suntime r1.0.1

Is there any debug option I can switch on to watch what’s happening under the hood? I tried --traceback, but it has no effect.

found the problem. The download_url function has been erroneously removed from the utility functions.
Quick fix:
open ~/.zerynth2/dist/–version–/ztc/base/zrequests.py and add:

def download_url(url,target_file):
    r = requests.get(url, allow_redirects=True)
    open(target_file, 'wb').write(r.content)
    return True

This should fix the issue. For debug info, run ztc -v <your-command>, when available additional debug info are printed.