Skip to content

Commit

Permalink
Symbols/Icons: Bugfix, avoid and warn for illegal values
Browse files Browse the repository at this point in the history
  • Loading branch information
plepe committed Aug 27, 2014
1 parent 142d27b commit 3f31bbe
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion pgmapcss/icons/process_icons.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ def build_icon(x, stat):
if os.path.exists(x['icon-image']):
return x['icon-image']

if True in x.values():
return True

src = x['icon-image'] + '-' + x['icon-width'] + '.svg'
dest = x['icon-image'] + '-' + x['icon-color'] + '-' + x['icon-width'] + '.svg'

Expand Down Expand Up @@ -37,4 +40,4 @@ def init(stat):
)

def process_icons(style_id, args, stat, conn):
images = stat.property_values('final-icon-image', value_type='value')
images = stat.property_values('final-icon-image', value_type='value', eval_true=False, warn_unresolvable=True)
5 changes: 4 additions & 1 deletion pgmapcss/symbols/process_symbols.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
def build_symbol(x, stat):
shapes = { 'triangle': 3, 'square': 4, 'pentagon': 5, 'hexagon': 6, 'heptagon': 7, 'octagon': 8, 'nonagon': 9, 'decagon': 10, 'circle': None }

if True in x.values():
return True

if x['symbol-shape'] not in shapes:
print('Warning: invalid shape {symbol-shape}'.format(x))
return None
Expand Down Expand Up @@ -78,4 +81,4 @@ def process_symbols(style_id, args, stat, conn):
pass

stat['symbols_dir'] = symbols_dir
images = stat.property_values('final-symbol-image', value_type='value')
images = stat.property_values('final-symbol-image', value_type='value', eval_true=False, warn_unresolvable=True)

0 comments on commit 3f31bbe

Please sign in to comment.