PaletteOptimiser

Changeset

101:065abc8520c5
2015-10-10 Paul Boddie raw files shortlog changelog graph Fixed the get_float function. simpleimage
optimiser.py (file)
     1.1 --- a/optimiser.py	Sat Oct 10 18:54:01 2015 +0200
     1.2 +++ b/optimiser.py	Sat Oct 10 23:55:15 2015 +0200
     1.3 @@ -367,9 +367,9 @@
     1.4  def get_float(options, flag):
     1.5      try:
     1.6          i = options.index(flag)
     1.7 -        if i+1 < len(options) and options[i+1].isdigit():
     1.8 +        try:
     1.9              return float(options[i+1])
    1.10 -        else:
    1.11 +        except (IndexError, ValueError):
    1.12              return 1.0
    1.13      except ValueError:
    1.14          return 0.0