fixed code incompatible with python3 in powerdiagram
This commit is contained in:
parent
891182587d
commit
4853446fa0
|
@ -52,7 +52,7 @@ class Machine(object):
|
||||||
def get_max_amperes(self):
|
def get_max_amperes(self):
|
||||||
capacity = None
|
capacity = None
|
||||||
if len(self.input_plugs) > 0:
|
if len(self.input_plugs) > 0:
|
||||||
capacity = self.input_plugs.values()[0].get_max_amperes()
|
capacity = list(self.input_plugs.values())[0].get_max_amperes()
|
||||||
capacity = add_capacity_constraints(capacity, self.current_capacity_constraint)
|
capacity = add_capacity_constraints(capacity, self.current_capacity_constraint)
|
||||||
return capacity
|
return capacity
|
||||||
|
|
||||||
|
@ -189,7 +189,7 @@ class Connection(object):
|
||||||
from_machine = self.from_plug.machine
|
from_machine = self.from_plug.machine
|
||||||
if from_machine.is_power_provider():
|
if from_machine.is_power_provider():
|
||||||
return from_machine
|
return from_machine
|
||||||
input_plug_names = from_machine.input_plugs.keys()
|
input_plug_names = list(from_machine.input_plugs.keys())
|
||||||
assert len(input_plug_names) == 1, "from_machine is supposed to be a power strip (which is expected to only have one input)"
|
assert len(input_plug_names) == 1, "from_machine is supposed to be a power strip (which is expected to only have one input)"
|
||||||
input_plug = from_machine.input_plugs[input_plug_names[0]]
|
input_plug = from_machine.input_plugs[input_plug_names[0]]
|
||||||
return input_plug.get_incoming_connection().get_power_provider()
|
return input_plug.get_incoming_connection().get_power_provider()
|
||||||
|
|
Loading…
Reference in New Issue