| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 6527442 commit dac3dd7
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -23,19 +23,23 @@ | |||
| 23 | 23 | INVERSE_COLORS["default"] = INVERSE_COLORS[CURTSIES_COLORS[0]] | |
| 24 | 24 | ||
| 25 | 25 | ||
| 26 | - def func_for_letter(l, default="k"): | ||
| 26 | + def func_for_letter(letter_color_code: str, default: str = "k"): | ||
| 27 | 27 | """Returns FmtStr constructor for a bpython-style color code""" | |
| 28 | - if l == "d": | ||
| 29 | - l = default | ||
| 30 | - elif l == "D": | ||
| 31 | - l = default.upper() | ||
| 32 | - return partial(fmtstr, fg=CNAMES[l.lower()], bold=l.isupper()) | ||
| 28 | + if letter_color_code == "d": | ||
| 29 | + letter_color_code = default | ||
| 30 | + elif letter_color_code == "D": | ||
| 31 | + letter_color_code = default.upper() | ||
| 32 | + return partial( | ||
| 33 | + fmtstr, | ||
| 34 | + fg=CNAMES[letter_color_code.lower()], | ||
| 35 | + bold=letter_color_code.isupper(), | ||
| 36 | + ) | ||
| 33 | 37 | ||
| 34 | 38 | ||
| 35 | - def color_for_letter(l, default="k"): | ||
| 36 | - if l == "d": | ||
| 37 | - l = default | ||
| 38 | - return CNAMES[l.lower()] | ||
| 39 | + def color_for_letter(letter_color_code: str, default: str = "k"): | ||
| 40 | + if letter_color_code == "d": | ||
| 41 | + letter_color_code = default | ||
| 42 | + return CNAMES[letter_color_code.lower()] | ||
| 39 | 43 | ||
| 40 | 44 | ||
| 41 | 45 | def parse(s): | |
| Back | FazBrowse Home | New Git URL |
0 commit comments