diff options
author | michael <michael@3ae390bd-cb1e-0410-b409-cd5a39f66f1f> | 2009-02-28 06:12:18 +0000 |
---|---|---|
committer | michael <michael@3ae390bd-cb1e-0410-b409-cd5a39f66f1f> | 2009-02-28 06:12:18 +0000 |
commit | 64522a267dccb2f0dc71d186b084c8c462a28f65 (patch) | |
tree | 447bd0be937022cf1854d922b10a835968f72389 /contrib/picoLCD/mrtg.py | |
parent | 71247fb889470f4f35ab745f02c4dd038da1b463 (diff) | |
download | lcd4linux-64522a267dccb2f0dc71d186b084c8c462a28f65.tar.gz |
added some contrib files from Nicu Pavel
git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@986 3ae390bd-cb1e-0410-b409-cd5a39f66f1f
Diffstat (limited to 'contrib/picoLCD/mrtg.py')
-rw-r--r-- | contrib/picoLCD/mrtg.py | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/contrib/picoLCD/mrtg.py b/contrib/picoLCD/mrtg.py new file mode 100644 index 0000000..e501ca9 --- /dev/null +++ b/contrib/picoLCD/mrtg.py @@ -0,0 +1,21 @@ +import urllib +import shutil + +download_path = "/tmp/" + +def saveimage(imageurl): + filename = imageurl.split('/')[-1] + tmpname = filename + ".tmp" + try: + urllib.urlretrieve(imageurl, download_path + tmpname) + except IOError: + return "Error downloading file" + else: + shutil.move(download_path + tmpname, download_path + filename) + return download_path + filename + + +#saveimage("http://www.switch.ch/network/operation/statistics/geant2-day.png") +#saveimage("http://192.168.12.113/mrtg/127.0.0.1_2-day.png") + + |