Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def put_pos(self, puts):
# Calculate pos for pins
for put in puts:
yield {'name': put,
'pos': int(centered(self.x, self.w * 0.8,
len(puts),
puts.index(put)))}
def put_pos_by_name(self, name, mode):
# Return pose x of pin by name
if mode == 'outputs':
for put in self.outputs:
if put == name:
return int(centered(self.x, self.w * 0.8,
len(self.outputs),
self.outputs.index(put)))
elif mode == 'inputs':
for put in self.inputs:
if put == name:
return int(centered(self.x, self.w * 0.8,
len(self.inputs),
self.inputs.index(put)))