Closed jbgriesner closed 6 years ago
A recent commit (https://github.com/rezemika/humanized_opening_hours/commit/ce5d7aedcdcb3d929d3ac2721c8491f38ba1b105) removed two "useless" methods. I'm not sure but it seems that at least one of these methods was not useless:
>>> oh = hoh.OHParser("24/7") >>> ohr = oh.render() >>> ohr.plaintext_week_description() AttributeError Traceback (most recent call last) <ipython-input-37-912ee1dfa78> in <module>() --> 1 ohr.plaintext_week_description() ~/.local/share/virtualenvs/idunn-8FJC_dD6/lib/python3.6/site-packages/humanized_opening_hours/main.py in plaintext_week_description(self, obj) 718 output = '' 719 for day in obj: --> 720 d = self.periods_of_day(day) 721 description = d.description if d.description else _("closed") 722 output += _("{name}: {periods}").format( ~/.local/share/virtualenvs/idunn-8FJC_dD6/lib/python3.6/site-packages/humanized_opening_hours/main.py in periods_of_day(self, day) 694 ) 695 rendered_periods = self._join_list(rendered_periods) --> 696 name = self.get_locale_day(day.weekday()) 697 return RenderableDay(name=name, description=rendered_periods, dt=d.date) 698 AttributeError: 'OHRenderer' object has no attribute 'get_locale_day'
It looks like the get_locale_day() function should not have been removed ... ?
get_locale_day()
You're right, thank you! It should be fixed by 63a484a. Just a single line that I forgot to change. >_<
I also added some unit tests to ensure it won't happen again. Thanks!
A recent commit (https://github.com/rezemika/humanized_opening_hours/commit/ce5d7aedcdcb3d929d3ac2721c8491f38ba1b105) removed two "useless" methods. I'm not sure but it seems that at least one of these methods was not useless:
It looks like the
get_locale_day()
function should not have been removed ... ?