#!/usr/bin/env python import sys import getopt try: import otolog4linux except: import src sys.modules['otolog4linux'] = src import src.__init__ as otolog4linux def usage(): print '%s : %s' % (otolog4linux.app_name, otolog4linux.app_title) print ' version %s' % otolog4linux.app_version sys.exit(2) player = None try: opts, args = getopt.getopt(sys.argv[1:], 'hp:v', ['help', 'player=']) except getopt.GetoptError: usage() for arg, val in opts: if arg == '--help': usage() if arg in ('-p', '--player'): player = val try: otocon = otolog4linux.getInstance() otocon.load_settings() if player: otocon.settings['player'] = player otocon.main() except Exception, e: print(e)