Projet

Général

Profil

Révision 7063330e

ID7063330e031922c63012990543e917a5d85cd25d
Parent 73f885e3
Enfant 86bee016

Ajouté par Lars Kruse il y a presque 6 ans

Fix python style issues reported by flake8

Additionally some python2-only "print" statements are now compatible
with python3.

Voir les différences:

plugins/weather/weather_
3 3
import os
4 4
import re
5 5
import sys
6
import urllib
6
from urllib.request import urlopen
7 7

  
8 8
url = 'http://www.weather.com/weather/today/%s'
9 9

  
......
19 19
elif len(sys.argv) == 2 and sys.argv[1] == "autoconf":
20 20
    print("yes")
21 21
elif len(sys.argv) == 2 and sys.argv[1] == "config":
22
    u = urllib.urlopen(url % code)
22
    u = urlopen(url % code)
23 23
    txt = u.read()
24 24
    u.close()
25 25

  
......
39 39

  
40 40
    print('graph_args --base 1000 -l 0')
41 41
else:
42
    u = urllib.urlopen(url % code)
42
    u = urlopen(url % code)
43 43
    txt = u.read()
44 44
    u.close()
45 45

  
......
53 53

  
54 54
    if len(TMP_F_list):
55 55
        TMP_F = TMP_F_list[0]
56
        TMP_C = (int(TMP_F) - 32) * 5/9
56
        TMP_C = (int(TMP_F) - 32) * 5 / 9
57 57
    else:
58 58
        sys.exit(1)
59 59

  

Formats disponibles : Unified diff