all repos — py-vite @ 013aafa64c5b26b8ac42eec52bfdc61d7ddab13d

the original vite, written in python

Fix format strings

I could've sworn this worked

Signed-off-by: Anirudh <icyph0x@pm.me>
Anirudh icyph0x@pm.me
Mon, 17 Jun 2019 16:46:24 +0530
commit

013aafa64c5b26b8ac42eec52bfdc61d7ddab13d

parent

575dd73a8a96e743ad0e39b8b3161cde390d8606

1 files changed, 9 insertions(+), 6 deletions(-)

jump to
M vite/vite.pyvite/vite.py

@@ -66,11 +66,14 @@ if os.path.exists(os.path.join(PAGES_PATH, head, tail)):

print(bad('Error: specified path exists.')) else: with open(os.path.join(PAGES_PATH, head, tail), 'w') as f: - f.write(f"""--- -template: -title: -date: {today} ----\n""") + to_write = ( + """--- + template + title:" + date: {today}" + ---\n""" + ).format(today) + f.write(to_write) print(good('Created %s.') % (os.path.join(PAGES_PATH, head, tail)))

@@ -193,7 +196,7 @@ handler = http.server.SimpleHTTPRequestHandler

os.chdir(os.path.join(os.getcwd(), BUILD_PATH)) try: with socketserver.TCPServer(('', PORT), handler) as httpd: - print(run(f'Serving the {italic(cyan("build"))} directory at {yellow(f"http://localhost:{PORT}")}')) + print(run('Serving the {italic} directory at {yellow}'.format(italic(cyan("build"), yellow("http://localhost:{PORT}"))))) print(white('Ctrl+C') + ' to stop.') httpd.serve_forever() except KeyboardInterrupt: