File: server.py

package info (click to toggle)
crawl 2%3A0.34.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 100,188 kB
  • sloc: cpp: 363,709; ansic: 27,765; javascript: 9,516; python: 8,463; perl: 3,293; java: 3,132; xml: 2,380; makefile: 1,835; sh: 611; objc: 250; cs: 15; sed: 9; lisp: 3
file content (26 lines) | stat: -rwxr-xr-x 958 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/usr/bin/env python
from __future__ import absolute_import

import os, sys

import webtiles, webtiles.server, webtiles.config

def server_main():
    if sys.version_info.major < 3:
        sys.exit("Python 2 is not supported, please upgrade!")
    # load config values from the traditional module location, which should
    # be in the same directory as this file
    import config as server_config
    webtiles.config.init_config_from_module(server_config)

    # server_path tells where to look for games.d. We can't default this,
    # because this directory is outside the module, and though it is set in
    # the current default `config.py` file, we still need to set it here for
    # backwards-compatibility reasons with dgamelaunch-config setups.
    # TODO: is there a better way to handle this?
    webtiles.config.server_path = os.path.dirname(os.path.abspath(__file__))

    webtiles.server.run()

if __name__ == "__main__":
    server_main()