diff --git a/plugins/tor/tor_ b/plugins/tor/tor_ index 066ca897..7029cb9c 100755 --- a/plugins/tor/tor_ +++ b/plugins/tor/tor_ @@ -134,11 +134,11 @@ class TorPlugin(object): @staticmethod def conf_from_dict(graph, labels): # header - for key, val in graph.iteritems(): + for key, val in graph.items(): print('graph_{} {}'.format(key, val)) # values - for label, attributes in labels.iteritems(): - for key, val in attributes.iteritems(): + for label, attributes in labels.items(): + for key, val in attributes.items(): print('{}.{} {}'.format(label, key, val)) @staticmethod @@ -253,7 +253,7 @@ class TorConnections(TorPlugin): states = dict((state, 0) for state in stem.ORStatus) for connection in connections: states[connection.rsplit(None, 1)[-1]] += 1 - for state, count in states.iteritems(): + for state, count in states.items(): print('{}.value {}'.format(state.lower(), count)) except stem.connection.AuthenticationFailure as e: print('Authentication failed ({})'.format(e))