Esempio n. 1
0
 def __init__(self, config_path='./'):
     Object.__init__(self)
     self.__config     = Config(config_path)
     self.__artwork    = database.Artwork(self)
     self.__lyrics     = database.Lyrics(self)
     self.__connection = Connection(self.config)
     self.__playback   = Playback(self.__connection, self.__config)
     args = [self.__connection, self.__playback, self.__config, self.__artwork, self.__lyrics]
     self.__library    = Library(*args)
     self.__playlist   = Playlist(*args)
Esempio n. 2
0
 def __init__(self, connection, playback, config, artwork, lyrics):
     Object.__init__(self)
     self.__connection = connection
     self.__playback = playback
     self.__config = config
     self.__artwork = artwork
     self.__lyrics = lyrics
     self.__data = []
     self.__connection.bind(self.__connection.CONNECT, self.__update_cache)
     self.__connection.bind(self.__connection.UPDATE_DATABASE, self.__update_cache)
Esempio n. 3
0
 def __init__(self, path='./'):
     """ initializes config by given path.
     
     Arguments:
         path -- string json config filepath.
     """
     self.path = path
     if not self.path[-1] == '/':
         self.path = self.path + '/'
     self.__config = {}
     Object.__init__(self)
     self.load()
Esempio n. 4
0
 def __init__(self, connection, playback, config, artwork, lyrics):
     Object.__init__(self)
     self.__connection = connection
     self.__playback = playback
     self.__config = config
     self.__artwork = artwork
     self.__lyrics = lyrics
     self.__data = []
     self.__selected = []
     self.__focused = None
     self.__current = None
     self.__connection.bind(self.__connection.CONNECT, self.__update_cache)
     self.__connection.bind(self.__connection.UPDATE_PLAYLIST, self.__update_cache)
     self.__connection.bind(self.__connection.UPDATE, self.__focus_playing)
Esempio n. 5
0
 def __init__(self, config):
     Object.__init__(self)
     threading.Thread.__init__(self)
     self.__running = False
     self.daemon = True
     self.__config = config
     self.__current = None
     self.__connection = None
     self.__lock = thread.allocate_lock()
     self.__status = ''
     # server status checker.
     self.__server_status = {}
     self.__check_playlist = None
     self.__check_library = None
     self.__server_status_song = None
     self.connected = False
Esempio n. 6
0
    def __init__(self, client):
        """init values and database."""
        self.__cache = CacheDict()
        sql_init = '''
        CREATE TABLE IF NOT EXISTS lyrics
        (
            artist TEXT,
            title TEXT,
            album TEXT,
            lyric TEXT,
            UNIQUE(artist, title, album)
        );
        '''
        sql_search = '''
        SELECT lyric FROM lyrics WHERE
            artist=? and
            title=? and
            album=?
        '''
        sql_write = '''
        INSERT OR REPLACE INTO lyrics
        (artist, title, album, lyric)
        VALUES(?,  ?,  ?,  ?)
        '''

        def sql_arg_parser(song):
            return (song.format('%artist%'),
                    song.format('%title%'),
                    song.format('%album%'))

        self.__data = SqliteDict(environment.config_dir + u'/lyrics',
                                 sql_init,
                                 sql_search,
                                 sql_arg_parser,
                                 sql_write,
                                 sql_arg_parser)
        self.client = client
        self.__downloading = []
        self.download_auto = False
        self.download_background = False
        self.downloaders = {'geci_me': True}
        self.download_class = {'geci_me': rest.GeciMe}
        Object.__init__(self)
Esempio n. 7
0
    def __init__(self, client):
        """init values and database."""
        self.client = client
        self.__download_path = environment.config_dir + '/artwork'
        self.__downloading = []
        self.download_auto = False
        self.download_background = False
        self.downloaders = {'lastfm': True}
        self.download_class = {'lastfm': rest.ArtworkLastfm}

        sql_init = '''
        CREATE TABLE IF NOT EXISTS artwork
        (   artist TEXT,
            album TEXT,
            artwork TEXT,
            UNIQUE(artist, album)
        );
        '''
        sql_search = '''
        SELECT artwork FROM artwork WHERE
            artist=? and
            album=?
        '''
        sql_write = '''
        INSERT OR REPLACE INTO artwork
        (artist, album, artwork)
        VALUES(?,  ?,  ?)
        '''

        def sql_arg_parser(song):
            return (song.format('%albumartist%'),
                    song.format('%album%'))

        self.__data = SqliteDict(environment.config_dir + '/artworkdb',
                                 sql_init,
                                 sql_search,
                                 sql_arg_parser,
                                 sql_write,
                                 sql_arg_parser)
        self.__cache = CacheDict()
        Object.__init__(self)
Esempio n. 8
0
	def __init__(self, name='collider_manager'):
		Object.__init__(self, name)
		self._collidable_sprites = []
		self._collidable_ref_sprite = None
Esempio n. 9
0
	def __init__(self, name):
		Object.__init__(self, name)
		self._fsm = None
		self._assign_properties = []
		self._transitions = {}
Esempio n. 10
0
 def __init__(self, connection, config):
     Object.__init__(self)
     self.connection = connection
     self.config = config