#!/usr/bin/python

import os
import sys
import shout
import datetime
import platform
import deefuzzer

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 https://github.com/yomguy/DeeFuzzer/blob/master/LICENSE

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

 recommends: icecast2, 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://github.com/yomguy/DeeFuzzer for more details and debugging.
        """

    return desc % (deefuzzer.__version__, platform_system, year)

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

if __name__ == '__main__':
    main()

