Mercurial > hg
comparison mercurial/color.py @ 30970:683606a829e8
color: rework conditional 'valideffect'
Not very important, but the full conditional is not that hard to follow and
having it unified make the function role a bit clearer in my opinion.
author | Pierre-Yves David <pierre-yves.david@ens-lyon.org> |
---|---|
date | Thu, 22 Dec 2016 02:30:03 +0100 |
parents | ddc80d1777a6 |
children | bb6385882cfa |
comparison
equal
deleted
inserted
replaced
30969:ddc80d1777a6 | 30970:683606a829e8 |
---|---|
114 def loadcolortable(ui, extname, colortable): | 114 def loadcolortable(ui, extname, colortable): |
115 _styles.update(colortable) | 115 _styles.update(colortable) |
116 | 116 |
117 def valideffect(effect): | 117 def valideffect(effect): |
118 'Determine if the effect is valid or not.' | 118 'Determine if the effect is valid or not.' |
119 good = False | 119 return ((not _terminfo_params and effect in _effects) |
120 if not _terminfo_params and effect in _effects: | 120 or (effect in _terminfo_params |
121 good = True | 121 or effect[:-11] in _terminfo_params)) |
122 elif (effect in _terminfo_params | |
123 or effect[:-11] in _terminfo_params): | |
124 good = True | |
125 return good |