You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

monkeystore-server.py 1.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. #!/usr/bin/python
  2. # -*- coding: utf-8 -*-
  3. __author__ = "Bernd Zeimetz"
  4. __contact__ = "bzed@debian.org"
  5. __license__ = """
  6. Copyright (C) 2010-2012 Bernd Zeimetz <bzed@debian.org>
  7. Copyright (C) 2012 Bernd Zeimetz <b.zeimetz@conova.com>
  8. Redistribution and use in source and binary forms, with or without
  9. modification, are permitted provided that the following conditions are
  10. met:
  11. 1. Redistributions of source code must retain the above copyright
  12. notice, this list of conditions and the following disclaimer.
  13. 2. Redistributions in binary form must reproduce the above
  14. copyright notice, this list of conditions and the following
  15. disclaimer in the documentation and/or other materials provided
  16. with the distribution.
  17. THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
  18. WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  19. MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  20. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR
  21. ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  22. DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
  23. GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  24. INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
  25. IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
  26. OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  27. ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  28. """
  29. import sys
  30. try:
  31. from monkeystore.web import app
  32. except ImportError:
  33. import sys
  34. import os
  35. sys.path = [os.path.realpath(os.path.dirname(__file__))] + sys.path
  36. from monkeystore.web import app
  37. if __name__ == '__main__':
  38. if len(sys.argv) > 1:
  39. host, port = sys.argv[1:]
  40. app.run(host=host, port=int(port), debug=True)
  41. else:
  42. app.run(debug=True)