Changeset 1191b462726781e08768bf371399e4d72e8d2e3e


Ignore:
Timestamp:
03/18/11 10:20:54 (14 months ago)
Author:
Luper Rouch <luper.rouch@…>
Children:
5d9b89368534bef5d6d1d2f934d91b8038cdbf64, f56aba4beaa44260dc60ea19bc0c00ade2fec895
Parents:
d80f16db4b1e9d11c88c229ae6f2b72385582fe4
git-committer:
Luper Rouch <luper.rouch@…> (03/18/11 10:20:54)
Message:

fixed dellcheck invalid prices handling

File:
1 edited

Legend:

Unmodified
Added
Removed
  • utils/dellcheck/src/dellcheck/__init__.py

    r39eca3a r1191b46  
    5555        prices = [p.strip().replace(" ", "").replace(" ", "") 
    5656            for p in options.price_pattern.findall(content)] 
    57         prices = [int(p) for p in prices] 
     57        parsed_prices = [] 
     58        for p in prices: 
     59            try: 
     60                parsed_prices.append(int(p)) 
     61            except ValueError: 
     62                logging.error("invalid price: %r" % p) 
     63        prices = parsed_prices 
    5864        if options.price_threshold is not None: 
    5965            prices = [p for p in prices if p > options.price_threshold] 
Note: See TracChangeset for help on using the changeset viewer.