pazz / alot

Terminal-based Mail User Agent
GNU General Public License v3.0
700 stars 163 forks source link

Ensure default ignorecase for external abooks. #1517

Closed mrichar1 closed 4 years ago

mrichar1 commented 4 years ago

Fix for #1516

mrichar1 commented 4 years ago

So if I'm reading it through right the logic (after this patch) is:

  1. Parent __init__ is called and sets self.reflags to re.IGNORECASE default) or 0 (depending on ignorecase).
  2. If child classes' reflags param is truthy (defaults to 0) then self.reflags is overwritten with this new value.

Do you mean that if say ignorecase=True AND reflags is truthy then they should be combined, i.e. self.reflags |= reflags

Happy to update it to do this, or some other variation, as you see fit. Also happy to update the docs to explain whichever is settled on.

pazz commented 4 years ago

Yes of course, you are right. I somehow thought that ignore case had preference but I was confused :) I think leaving the code as is (with a preference to reflags) is fine. In fact, reflags is never actually used anywhere: It is not read from the config file nor used from within alot as far as I can see. So we could even remove this parameter entirely.

mrichar1 commented 4 years ago

OK, I'll update the docstrings to explain the ordering just now...