3 __author__ = "Artur Duque de Souza"
4 __author_email__ = "artur.souza@indt.org.br"
7 __thanks__ = "Gustavo Sverzut Barbieri"
8 __GMS_DATA_DIR__ = "/usr/share/gms/"
15 if os.path.exists (__GMS_DATA_DIR__):
16 sys.path.append(__GMS_DATA_DIR__)
18 from lib.server import serve_forever, load_plugins_transcoders
19 from lib.utils import config
23 for p in sys.argv[1:]:
24 if p == "-v" or p == "--verbose":
27 log.basicConfig(level=log_level,
28 format=("### %(asctime)s %(name)-18s \t%(levelname)-8s "
30 datefmt="%Y-%m-%d %H:%M:%S")
32 if config.get_transcoded_location () is None:
33 print "Gms not configured"
36 if not os.path.exists(config.get_transcoded_location()):
37 os.mkdir(config.get_transcoded_location())
47 print >>sys.stderr, "Fail to start deamon: %d (%s)" % (e.errno, e.strerror)
57 fp = open ("/var/run/gms.pid", "w")
62 print >>sys.stderr, "Fail to start deamon: %d (%s)" % (e.errno, e.strerror)
66 pd = os.path.join(__GMS_DATA_DIR__, "plugins", "transcoders")
67 if os.path.exists (pd):
68 load_plugins_transcoders(pd)
70 pd = os.path.join("plugins", "transcoders");
71 if os.path.exists (pd):
72 load_plugins_transcoders(pd)