ignore XML tags that are not in DAV: namespace
[pandav-og.git] / server.py
blobbce706d6f747e725a10736dfd25ec745a0f47c48
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
6 import sys
8 if len(sys.argv) == 3:
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])
12 else:
13 sharedir = u'/'
14 serverport = 8080
17 ## Start the server
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