-
Notifications
You must be signed in to change notification settings - Fork 2
Fixing command line script #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
|
Les formats ont changé sur Cooptel? |
| if type == "json": | ||
| return api.getData(phase,room,datetime.now().month) | ||
| if type =="all": | ||
| return "Used :\t\t{:0.2f}GB ({:0.2f}%)\nLeft :\t\t{:0.2f}GB ({:0.2f}%)\nTotal :\t\t{:0.2f}GB".format(data["usage"],pct,data["left"],100-pct,data["maximum"]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cooptel les donne en GB maintenant?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
J'imagine parce que j'ai pas changer l'interprétation des données dans le fichier api.py.
|
Wow, le formattage de cette lib là est vraiment troublant... |
|
En fait, l'output json reste le meme sur getData dans l'api. Mais pour le netusage.py j'utilise le dict direct sans le formatter en json. J'ai tester les differentes commandes avec les types et les outputs me semble correct. Par exemple, '... netusage.py all ...' avec mes fixes me donne: |
|
donc le seul fix réel devrait être l'ajout de la variable? |
|
Mais pour définir cette variable avec la version originale de l'api.py, j'ai besoin du dictionnaire et non du json. Je comprends que l'api retourne un json au source externe. Toutefois, vu que tu importes le api.py dans ton netusage.py, ça servirait a rien de devoir parser à nouveau le json. |
The command line script was returning error, so with some quick fixes, it's now meeting the expected behaviour.