mirror of
https://github.com/jongracecox/anybadge.git
synced 2025-12-16 02:20:06 +01:00
Drop <3.7 support and add type hints (#59)
- Drop support for Python <3.7 - Bump the pre-commit version used in CI - Add type hinting and docstrings - Add mypy to pre-commit config - Fix typing issues - Update colors module - Update colors module to use uppercase hex codes - Add `__lt__` to allow sorting colors by name - Fix `build_examples.py` to work with color Enum - Update example badges in `README.md` - Fix typing issues in server - Update travis links in `README.md` - Fix PyPi deployment bug (#60)
This commit is contained in:
@@ -3,21 +3,20 @@ import anybadge
|
||||
if __name__ == "__main__":
|
||||
|
||||
print(
|
||||
"""| Color Name | Hex Code | Example |
|
||||
| ---------- | -------- | ------- |"""
|
||||
"""
|
||||
| Color Name | Hex | Example |
|
||||
| ------------- | ------- | ------- |"""
|
||||
)
|
||||
for color, hex in sorted(anybadge.COLORS.items()):
|
||||
for color in sorted(anybadge.colors.Color):
|
||||
|
||||
file = "examples/color_" + color + ".svg"
|
||||
file = "examples/color_" + color.name.lower() + ".svg"
|
||||
|
||||
url = "https://cdn.rawgit.com/jongracecox/anybadge/master/" + file
|
||||
|
||||
anybadge.Badge(label="Color", value=color, default_color=color).write_badge(
|
||||
file, overwrite=True
|
||||
)
|
||||
anybadge.Badge(
|
||||
label="Color", value=color.name.lower(), default_color=color.value
|
||||
).write_badge(file, overwrite=True)
|
||||
|
||||
print(
|
||||
"| {color} | {hex} |  |".format(
|
||||
color=color, hex=hex.upper(), url=url
|
||||
)
|
||||
f"| {color.name.lower():<13} | {color.value.upper():<7} | ':<84}|"
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user