gmyth-stream/server/0.3/gms.py
author leo_sobral
Thu Aug 16 15:24:01 2007 +0100 (2007-08-16)
branchtrunk
changeset 808 215c45290ce3
parent 723 f5f7abc760aa
child 815 7f290a3a34b1
permissions -rw-r--r--
[svn r814] Added x error handling to playbin maemo
     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()