chk1 / stw2openmensa

Convert canteen meal data from Studentenwerk Münster XML to OpenMensa Feed v2 XML format
http://openmensa.org/#14/51.9646/7.6159
MIT License
3 stars 2 forks source link

Strip spaces from meal classification #12

Closed chk1 closed 4 years ago

chk1 commented 4 years ago

CI throws a (caught) error for Python 3.x tests:

Processing "mensa_steinfurt.xml" Conversion of "mensa_steinfurt.xml" failed: 'vgn '
Traceback (most recent call last):
  File "parser.py", line 208, in <module>
    status = StudentenwerkToOpenmensa(config.BASE_URL, config.OUT_DIR, config.USER_AGENT, filename)
  File "parser.py", line 152, in StudentenwerkToOpenmensa
    for foodicon in foodicons:
  File "parser.py", line 70, in <lambda>
    fis = map(lambda x: config.CLASSIFICATION[x.lower()], fis)
KeyError: 'vgn '

vgn should be vgn (without spaces) to match an item in the classification list

https://github.com/chk1/stw2openmensa/blob/master/config.py#L68

Code change somewhere here https://github.com/chk1/stw2openmensa/blob/master/parser.py#L69

gfranco93 commented 4 years ago

Im on it

chk1 commented 4 years ago

Thank you!