mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
Port pelican to python 3.
Stays compatible with 2.x series, thanks to an unified codebase.
This commit is contained in:
parent
9847394e12
commit
71995d5e1b
43 changed files with 495 additions and 287 deletions
20
pelican/server.py
Normal file
20
pelican/server.py
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
from __future__ import print_function
|
||||
try:
|
||||
import SimpleHTTPServer as srvmod
|
||||
except ImportError:
|
||||
import http.server as srvmod
|
||||
|
||||
try:
|
||||
import SocketServer as socketserver
|
||||
except ImportError:
|
||||
import socketserver
|
||||
|
||||
PORT = 8000
|
||||
|
||||
Handler = srvmod.SimpleHTTPRequestHandler
|
||||
|
||||
httpd = socketserver.TCPServer(("", PORT), Handler)
|
||||
|
||||
print("serving at port", PORT)
|
||||
httpd.serve_forever()
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue