mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-20 12:24:59 +00:00
style: Format code with consistent quotes and line breaks
This commit is contained in:
parent
c6e544750b
commit
8935c87d7a
1 changed files with 33 additions and 28 deletions
|
@ -5,9 +5,9 @@ Reads the Glass_TTY_VT220.ttf font and creates an SVG with the word "aider"
|
|||
in terminal green (#14b014) on a white background.
|
||||
"""
|
||||
|
||||
import argparse
|
||||
import base64
|
||||
import os
|
||||
import argparse
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
|
@ -25,10 +25,10 @@ def generate_svg_with_embedded_font(font_path, text="aider", color="#14b014", ou
|
|||
str: The SVG content
|
||||
"""
|
||||
# Read the font file and encode it as base64
|
||||
with open(font_path, 'rb') as f:
|
||||
with open(font_path, "rb") as f:
|
||||
font_data = f.read()
|
||||
|
||||
font_base64 = base64.b64encode(font_data).decode('utf-8')
|
||||
font_base64 = base64.b64encode(font_data).decode("utf-8")
|
||||
|
||||
# Calculate SVG dimensions based on text length
|
||||
# These values can be adjusted to modify the appearance
|
||||
|
@ -63,7 +63,7 @@ def generate_svg_with_embedded_font(font_path, text="aider", color="#14b014", ou
|
|||
|
||||
# Save to file or print to stdout
|
||||
if output_path:
|
||||
with open(output_path, 'w') as f:
|
||||
with open(output_path, "w") as f:
|
||||
f.write(svg)
|
||||
print(f"SVG logo saved to {output_path}")
|
||||
|
||||
|
@ -71,15 +71,23 @@ def generate_svg_with_embedded_font(font_path, text="aider", color="#14b014", ou
|
|||
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser(description='Generate an SVG logo with embedded font')
|
||||
parser.add_argument('--font', type=str, default='aider/website/assets/Glass_TTY_VT220.ttf',
|
||||
help='Path to the TTF font file')
|
||||
parser.add_argument('--text', type=str, default='aider',
|
||||
help='Text to display in the SVG')
|
||||
parser.add_argument('--color', type=str, default='#14b014',
|
||||
help='Color of the text (hex format)')
|
||||
parser.add_argument('--output', type=str, default='aider/website/assets/logo.svg',
|
||||
help='Path to save the SVG file')
|
||||
parser = argparse.ArgumentParser(description="Generate an SVG logo with embedded font")
|
||||
parser.add_argument(
|
||||
"--font",
|
||||
type=str,
|
||||
default="aider/website/assets/Glass_TTY_VT220.ttf",
|
||||
help="Path to the TTF font file",
|
||||
)
|
||||
parser.add_argument("--text", type=str, default="aider", help="Text to display in the SVG")
|
||||
parser.add_argument(
|
||||
"--color", type=str, default="#14b014", help="Color of the text (hex format)"
|
||||
)
|
||||
parser.add_argument(
|
||||
"--output",
|
||||
type=str,
|
||||
default="aider/website/assets/logo.svg",
|
||||
help="Path to save the SVG file",
|
||||
)
|
||||
|
||||
args = parser.parse_args()
|
||||
|
||||
|
@ -96,10 +104,7 @@ def main():
|
|||
|
||||
# Generate the SVG
|
||||
generate_svg_with_embedded_font(
|
||||
args.font,
|
||||
text=args.text,
|
||||
color=args.color,
|
||||
output_path=args.output
|
||||
args.font, text=args.text, color=args.color, output_path=args.output
|
||||
)
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue