Permalink
Browse files

Improves support for new evepaste parsers

  • Loading branch information...
1 parent cc99223 commit c76483699d368ac0cc96215bdf3a91bca0b659f2 @sudorandom sudorandom committed Feb 21, 2015
Showing with 9 additions and 32 deletions.
  1. +4 −16 evepraisal/helpers.py
  2. +4 −15 evepraisal/parser.py
  3. +1 −1 requirements.txt
View
@@ -14,21 +14,7 @@ def decorated_function(*args, **kwargs):
def iter_types(kind, result):
- if kind in ['assets',
- 'contract',
- 'dscan',
- 'fitting',
- 'listing',
- 'cargo_scan',
- 'loot_history',
- 'pi',
- 'survey_scanner',
- 'view_contents',
- 'heuristic']:
- for item in result:
- item['quantity'] = item.get('quantity', 1)
- yield item
- elif kind == 'bill_of_materials':
+ if kind == 'bill_of_materials':
for item in result:
yield {'name': item['name'],
'quantity': item.get('you', item.get('quantity'))}
@@ -57,4 +43,6 @@ def iter_types(kind, result):
item['quantity'] = item.get('quantity', 1)
yield item
else:
- raise ValueError('Invalid kind %s', kind)
+ for item in result:
+ item['quantity'] = item.get('quantity', 1)
+ yield item
View
@@ -14,21 +14,10 @@ def parse(raw_paste):
representative_kind = 'unknown'
largest_kind_num = 0
- parser_list = [('loot_history', parsers.parse_loot_history),
- ('survey_scanner', parsers.parse_survey_scanner),
- ('pi', parsers.parse_pi),
- ('dscan', dscan_parser),
- ('killmail', parsers.parse_killmail),
- ('chat', parsers.parse_chat),
- ('eft', parsers.parse_eft),
- ('fitting', parsers.parse_fitting),
- ('contract', parsers.parse_contract),
- ('assets', parsers.parse_assets),
- ('view_contents', parsers.parse_view_contents),
- ('wallet', parsers.parse_wallet),
- ('cargo_scan', parsers.parse_cargo_scan),
- ('listing', listing_parser),
- ('heuristic', tryhard_parser)]
+ parser_list = list(evepaste.PARSER_TABLE) + [
+ ('listing', listing_parser),
+ ('heuristic', tryhard_parser),
+ ]
iterations = 0
while iterations < 10:
View
@@ -6,5 +6,5 @@ Flask-Cache
Flask-Babel
flask_openid
flask-sqlalchemy
-evepaste
+evepaste>=0.9
git+git://github.com/ntt/reverence.git

0 comments on commit c764836

Please sign in to comment.