1 # Copyright (c) 2005.-2006. Ivan Voras <ivoras@gmail.com>
2 # Released under the Artistic License
4 from davserver
import *
5 from fsdav
import DirCollection
, FileMember
9 assert(type(sys
.argv
[1]) == str) # make sure that the argument is in ASCII encoding, as we rely on that
10 sharedir
= unicode(sys
.argv
[1])
11 serverport
= int(sys
.argv
[2])
18 print "PanDAV (c)2005. Ivan Voras <ivoras@gmail.com>"
19 print "Serving %s on port %d ..." % (sharedir
, serverport
)
21 server_address
= ('', serverport
)
22 root
= DirCollection(sharedir
, u
'/')
23 httpd
= DAVServer(server_address
, DAVRequestHandler
, root
)
24 httpd
.serve_forever() # todo: add some control over starting and stopping the server