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/torrent/deluge_
121 121
log.setLevel(logging.WARNING)
122 122

  
123 123
conf = {
124
    'host':       os.getenv('host', '127.0.0.1'),
125
    'port':       int(os.getenv('port', '58846')),
126
    'username':   os.getenv('username', ''),
127
    'password':   os.getenv('password', '')
124
    'host': os.getenv('host', '127.0.0.1'),
125
    'port': int(os.getenv('port', '58846')),
126
    'username': os.getenv('username', ''),
127
    'password': os.getenv('password', '')
128 128
}
129 129

  
130 130
names_for_munin = {
131
    'numConnections':        'numConnections',
132
    'payloadUploadRate':     'payloadUploadRate',
133
    'overheadUploadRate':    'overheadUploadRate',
134
    'payloadDownloadRate':   'payloadDownloadRate',
135
    'overheadDownloadRate':  'overheadDownloadRate',
136
    'state.Seeding':         'seeding',
137
    'state.Downloading':     'downloading',
138
    'state.Paused':          'paused',
139
    'state.Error':           'error',
140
    'state.Queued':          'queued',
141
    'state.Checking':        'checking',
142
    'state.Other':           'other'
131
    'numConnections': 'numConnections',
132
    'payloadUploadRate': 'payloadUploadRate',
133
    'overheadUploadRate': 'overheadUploadRate',
134
    'payloadDownloadRate': 'payloadDownloadRate',
135
    'overheadDownloadRate': 'overheadDownloadRate',
136
    'state.Seeding': 'seeding',
137
    'state.Downloading': 'downloading',
138
    'state.Paused': 'paused',
139
    'state.Error': 'error',
140
    'state.Queued': 'queued',
141
    'state.Checking': 'checking',
142
    'state.Other': 'other'
143 143
}
144 144

  
145 145
torrent_states = ["Downloading",
......
300 300
            "graph_info This graph shows the number of connections used by Deluge Torrent")
301 301
        print(names_for_munin["numConnections"] + ".label connections")
302 302
        print(names_for_munin["numConnections"] + ".min 0")
303
        print(names_for_munin["numConnections"] +
304
              ".info The number of connections used by Deluge Torrent")
303
        print(names_for_munin["numConnections"]
304
              + ".info The number of connections used by Deluge Torrent")
305 305
    elif mode == "bandwidth":
306 306
        print("graph_title Bandwidth usage")
307 307
        print("graph_order payloadDownloadRate overheadDownloadRate payloadUploadRate "
......
353 353
        print("graph_period second")
354 354

  
355 355
        for state_name in torrent_states:
356
            print(names_for_munin["state." +
357
                                  state_name] + ".label " + state_name)
356
            print(names_for_munin["state." + state_name] + ".label " + state_name)
358 357
            print(names_for_munin["state." + state_name] + ".draw AREASTACK")
359 358
            print(names_for_munin["state." + state_name] + ".type GAUGE")
360 359
            print(names_for_munin["state." + state_name] + ".min 0")
361
            print(names_for_munin["state." + state_name] +
362
                  ".info Number of torrents in the '" + state_name + "' state")
360
            print(names_for_munin["state." + state_name]
361
                  + ".info Number of torrents in the '" + state_name + "' state")
363 362

  
364 363

  
365 364
def fetch_info(mode):

Formats disponibles : Unified diff