gmyth-stream/server/0.3/gms.py
author renatofilho
Thu Aug 16 14:46:11 2007 +0100 (2007-08-16)
branchtrunk
changeset 807 add4025ca678
parent 723 f5f7abc760aa
child 815 7f290a3a34b1
permissions -rw-r--r--
[svn r813] created a timeout function for invalid channels
     1 #!/usr/bin/env python
     2 
     3 __author__ = "Artur Duque de Souza"
     4 __author_email__ = "artur.souza@indt.org.br"
     5 __license__ = "GPL"
     6 __version__ = "0.3"
     7 __thanks__ = "Gustavo Sverzut Barbieri"
     8 
     9 import sys
    10 import os
    11 import mimetypes
    12 import logging as log
    13 from lib.server import serve_forever, load_plugins_transcoders
    14 
    15 mimetypes.init()
    16 log_level = log.INFO
    17 for p in sys.argv[1:]:
    18     if p == "-v" or p == "--verbose":
    19         log_level -= 10
    20 
    21 log.basicConfig(level=log_level,
    22                 format=("### %(asctime)s %(name)-18s \t%(levelname)-8s "
    23                         "\t%(message)s"),
    24                 datefmt="%Y-%m-%d %H:%M:%S")
    25 
    26 if not os.path.exists(".transcoded"):
    27     os.mkdir(".transcoded")
    28 
    29 pd = os.path.join("plugins", "transcoders")
    30 load_plugins_transcoders(pd)
    31 serve_forever()