Skip to content

Commit

Permalink
[enh] fix some pep8 formating errors
Browse files Browse the repository at this point in the history
  • Loading branch information
pointhi committed Aug 23, 2016
1 parent cd0a103 commit 6261517
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
12 changes: 6 additions & 6 deletions pcb/check_kicad_mod.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
import argparse
from kicad_mod import *
import sys, os
#point to the correct location for the print_color script
sys.path.append(os.path.join(sys.path[0],'..','schlib'))
# point to the correct location for the print_color script
sys.path.append(os.path.join(sys.path[0], '..', 'schlib'))

from print_color import *
from rules import *

#enable windows wildcards
# enable windows wildcards
from glob import glob

parser = argparse.ArgumentParser()
Expand All @@ -21,7 +21,7 @@
parser.add_argument('-v', '--verbose', help='show status of all modules and extra information about the violation', action='store_true')
args = parser.parse_args()

printer = PrintColor(use_color = not args.nocolor)
printer = PrintColor(use_color=not args.nocolor)

return_val = 0

Expand All @@ -35,7 +35,7 @@

for f in args.kicad_mod_files:
files += glob(f)

for filename in files:
try:
module = KicadMod(filename)
Expand All @@ -51,7 +51,7 @@
if rule.check():
n_violations += 1
return_val = 1
printer.yellow('Violating ' + rule.name, indentation=2)
printer.yellow('Violating ' + rule.name, indentation=2)
if args.verbose:
printer.light_blue(rule.description, indentation=4, max_width=100)

Expand Down
12 changes: 6 additions & 6 deletions sch/add_part_number.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,23 +38,23 @@

for component in sch.components:
# check if is power related component
if ('#PWR' in component.fields[0]['ref'] or
'PWR_FLAG' in component.fields[1]['ref']):
if '#PWR' in component.fields[0]['ref'] or\
'PWR_FLAG' in component.fields[1]['ref']:
continue

# create or get the PN field
for field in component.fields:
if field['name'].replace('"','') == args.pn_field_name:
if field['name'].replace('"', '') == args.pn_field_name:
break
else:
field = component.addField({'name':'"%s"' % args.pn_field_name, 'ref':'"~"'})
field = component.addField({'name': '"%s"' % args.pn_field_name, 'ref': '"~"'})

# component reference
comp_ref = component.fields[0]['ref'].replace('"','')
comp_ref = component.fields[0]['ref'].replace('"', '')

# search the component in the BOM items and get the PN
for item in bom:
item_refs = item[ref_col].replace(' ','').split(',')
item_refs = item[ref_col].replace(' ', '').split(',')
if item[pn_col] and comp_ref in item_refs:
field['ref'] = '"' + item[pn_col] + '"'
break
Expand Down
8 changes: 4 additions & 4 deletions sch/update_footprints.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,16 @@

for component in sch.components:
# check if is power related component
if ('#PWR' in component.fields[0]['ref'] or
'PWR_FLAG' in component.fields[1]['ref']):
if '#PWR' in component.fields[0]['ref'] or\
'PWR_FLAG' in component.fields[1]['ref']:
continue

# component reference
comp_ref = component.fields[0]['ref'].replace('"','')
comp_ref = component.fields[0]['ref'].replace('"', '')

# search the component in the BOM items and get the PN
for item in bom:
item_refs = item[ref_col].replace(' ','').split(',')
item_refs = item[ref_col].replace(' ', '').split(',')
if item[fp_col] and comp_ref in item_refs:
# set component footprint
component.fields[2]['ref'] = '"' + item[fp_col] + '"'
Expand Down

0 comments on commit 6261517

Please sign in to comment.