Code Repositories xandikos / cc6cea2
Add xandikos script. Jelmer Vernooń≥ 3 years ago
3 changed file(s) with 32 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
0 #!/usr/bin/env python3
1 # Xandikos
2 # Copyright (C) 2016 Jelmer Vernooij <jelmer@jelmer.uk>
3 #
4 # This program is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU General Public License
6 # as published by the Free Software Foundation; version 2
7 # of the License or (at your option) any later version of
8 # the License.
9 #
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
14 #
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write to the Free Software
17 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
18 # MA 02110-1301, USA.
19
20 import sys
21
22 from xandikos.web import main
23
24 main(sys.argv)
3232 url="https://www.jelmer.uk/projects/xandikos",
3333 requires=['icalendar', 'dulwich', 'defusedxml'],
3434 packages=['xandikos'],
35 scripts=['bin/xandikos'],
3536 classifiers=[
3637 'Development Status :: 4 - Beta',
3738 'License :: OSI Approved :: GNU General Public License v3 or later (GPLv2+)',
509509 return self._inner_app(environ, start_response)
510510
511511
512 if __name__ == '__main__':
512 def main(argv):
513513 import optparse
514514 import sys
515515 parser = optparse.OptionParser()
529529 parser.add_option("--dav-root",
530530 default="/",
531531 help="Path to DAV root.")
532 options, args = parser.parse_args(sys.argv)
532 options, args = parser.parse_args(argv)
533533
534534 if options.directory is None:
535535 parser.print_usage()
543543 app = WellknownRedirector(app)
544544 server = make_server(options.listen_address, options.port, app)
545545 server.serve_forever()
546
547
548 if __name__ == '__main__':
549 main(sys.argv)