mirror of
https://github.com/balkian/gists.git
synced 2024-11-22 09:42:28 +00:00
This commit is contained in:
parent
9222a1ec28
commit
f7c346463b
15
kemsirve.py
15
kemsirve.py
@ -1,10 +1,15 @@
|
|||||||
from __future__ import print_function
|
from __future__ import print_function
|
||||||
|
|
||||||
import requests
|
import requests
|
||||||
import Tkinter
|
try:
|
||||||
import tkMessageBox
|
import Tkinter as tk
|
||||||
|
import tkMessageBox as tkm
|
||||||
|
except Exception:
|
||||||
|
import tkinter as tk
|
||||||
|
from tkinter import messagebox as tkm
|
||||||
|
|
||||||
window = Tkinter.Tk()
|
|
||||||
|
window = tk.Tk()
|
||||||
window.wm_withdraw()
|
window.wm_withdraw()
|
||||||
|
|
||||||
resp = requests.get("https://ws.ovh.com/dedicated/r2/ws.dispatcher/getAvailability2")
|
resp = requests.get("https://ws.ovh.com/dedicated/r2/ws.dispatcher/getAvailability2")
|
||||||
@ -13,4 +18,6 @@ for i in resp.json()["answer"]["availability"]:
|
|||||||
for j in i["metaZones"]:
|
for j in i["metaZones"]:
|
||||||
if j["availability"] not in ["unavaible", "unknown"]:
|
if j["availability"] not in ["unavaible", "unknown"]:
|
||||||
print(j["zone"], j["availability"])
|
print(j["zone"], j["availability"])
|
||||||
tkMessageBox.showinfo(title="Greetings", message="%s - %s!" % (j["zone"], j["availability"]))
|
tkm.showinfo(title="Greetings", message="%s: %s - %s!" % (i["reference"],
|
||||||
|
j["zone"],
|
||||||
|
j["availability"]))
|
Loading…
Reference in New Issue
Block a user