コード例 #1
0
ファイル: Interface.py プロジェクト: stevenviola/pyxis
    def __init__(self, opts, station):
        """Initilize the interface

        opts: a dictionary of command line options
        station: station requested as an argument"""
        cleanDebug()
        self.histfile = None
        self.config = Config()

        self.sirius = Sirius()
        self.player = Player(opts)
        self.options = opts

        atexit.register(self.onExit)

        if opts.list:
            self.list()
            sys.exit(0)

        if opts.setup:
            self.setup()
            sys.exit(0)

        self.notification = toBool(self.config.settings.notifications)

        if station != None:
            self.play(station)
        else:
            self.repl()
コード例 #2
0
ファイル: Sirius.py プロジェクト: stevenviola/pyxis
    def __init__(self):
        #Get settings
        config = Config()
        self.account = config.account
        self.settings = config.settings

        self.host = 'www.sirius.com'
        self.__headers = {'User-agent': 'Mozilla/5.0 (X11; U; %s i686; en-US; rv:1.8.0.7) github.com/kasuko/pyxis Firefox/1.5.0.7' % \
                        sys.platform}
        self.token = ''
        self.__stream = None
        self.asxURL = None
        self.allstreams = []
        self.playing = None
        self.__cookie_jar = None

        if self.account.login_type not in ['subscriber', 'guest']:
            print 'invalid login_type in config file'
            sys.exit(101)

        if toBool(self.account.canada):
            self.provider = ProviderCanada(self)
        else:
            self.provider = ProviderUSA(self)

        self.cookiefile = os.path.join(config.confpath, 'cookies.txt')
        self.playlist = os.path.join(config.confpath, 'playlist')
        self.__setupOpener()
コード例 #3
0
ファイル: Interface.py プロジェクト: ninetyfivenorth/pyxis
    def __init__(self, opts, station):
        """Initilize the interface

        opts: a dictionary of command line options
        station: station requested as an argument"""
        cleanDebug()
        self.histfile = None
        self.config = Config()

        self.sirius = Sirius()
        self.player = Player(opts)
        self.options = opts

        atexit.register(self.onExit)

        if opts.list:
            self.list()
            sys.exit(0)

        if opts.setup:
            self.setup()
            sys.exit(0)

        self.notification = toBool(self.config.settings.notifications)

        if station != None:
            self.play(station)
        else:
            self.repl()
コード例 #4
0
    def __init__(self):
        #Get settings
        config = Config()
        self.account = config.account
        self.settings = config.settings

        self.host = 'www.sirius.com'
        self.__headers = {'User-agent': 'Mozilla/5.0 (X11; U; %s i686; en-US; rv:1.8.0.7) github.com/kasuko/pyxis Firefox/1.5.0.7' % \
                        sys.platform}
        self.token = ''
        self.__stream = None
        self.asxURL = None
        self.allstreams = []
        self.playing = None
        self.__cookie_jar = None

        if self.account.login_type not in ['subscriber', 'guest']:
            print 'invalid login_type in config file'
            sys.exit(101)

        if toBool(self.account.canada):
            self.provider = ProviderCanada(self)
        else:
            self.provider = ProviderUSA(self)

        self.cookiefile = os.path.join(config.confpath, 'cookies.txt')
        self.playlist = os.path.join(config.confpath, 'playlist')
        self.__setupOpener()
コード例 #5
0
ファイル: Debug.py プロジェクト: Ionshard/pyxis
def __debugging():
    global __debug
    if __debug == None:
        config = Config()
        __debug = toBool(config.debug.debug)

    return __debug
コード例 #6
0
ファイル: StreamHandler.py プロジェクト: jvc/sipie
    def __init__(self):

        config = Config()
        self.settings = config.mediaplayer
        self.debug = toBool(config.settings.debug)
        self.location = None
        self.processIn = None
        self.processOut = None
        self.command = "%s %s" % (self.settings.command, self.settings.options)