#!/usr/bin/python

import os
import sys
import shout
import datetime
import platform
from deefuzzer.core import DeeFuzzer
from deefuzzer import __version__

year = datetime.datetime.now().strftime("%Y")
platform_system = platform.system()


def prog_info():
    desc = """ deefuzzer : easy and instant media streaming tool
 version : %s
 running on system : %s

 Copyright (c) 2007-%s Guillaume Pellerin <yomguy@parisson.com>
 All rights reserved.

 This software is licensed as described in the file COPYING, which
 you should have received as part of this distribution. The terms
 are also available at http://svn.parisson.org/deefuzzer/DeeFuzzerLicense

 depends:  python, python-dev, python-xml, python-shout | shout-python, libshout3,
           libshout3-dev, icecast2, python-mutagen

 recommends: python-twitter, python-tinyurl, python-liblo | pyliblo (>= 0.26)

 Usage : deefuzzer [file]

  where [file] is the path for a XML config file. 
  
  Edit an example in example/deefuzzer.xml
  and then start one or more stations: 
 
  $ deefuzzer example/deefuzzer.xml

 see http://svn.parisson.org/deefuzzer/ for more details
        """

    return desc % (__version__, platform_system, year)

def main():
    if len(sys.argv) >= 2:
        d = DeeFuzzer(sys.argv[-1])
        d.start()
    else:
        text = prog_info()
        sys.exit(text)

if __name__ == '__main__':
    main()

