File: test_website.py

package info (click to toggle)
zim 0.76.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 10,952 kB
  • sloc: python: 68,612; xml: 1,270; javascript: 512; sh: 101; makefile: 47
file content (18 lines) | stat: -rwxr-xr-x 386 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/usr/bin/python3

import os
import subprocess

from http.server import HTTPServer
from http.server import SimpleHTTPRequestHandler

subprocess.call('./tools/build_website.sh')

os.chdir('./html')

try:
	server = HTTPServer(('', 8080), SimpleHTTPRequestHandler)
	print('server started at http://localhost:8080')
	server.serve_forever()
except KeyboardInterrupt:
	server.socket.close()