Пример #1
0
    def __init__(self):

        self.__cache = []

        self.__configurators = []

        Device.__init__(self)
Пример #2
0
    def __init__(self):

        # genre list
        self.__genres = []

        self.__current_folder = None

        Device.__init__(self)
Пример #3
0
    def __init__(self):

        try:
            os.makedirs(_SEARCH_CACHE_DIR)
        except:
            pass

        self.__fileserver = FileServer()
        self.__flv_downloader = None

        self.__items = []
        self.__current_folder = None

        Device.__init__(self)
Пример #4
0
    def __init__(self):

        # list of (name, playlist) tuples
        self.__lists = []

        # the currently selected playlist
        self.__current_list = None

        # the folder of the currently selected playlist
        self.__current_folder = None

        # whether the playlists need to be reloaded from files
        self.__needs_playlist_reload = True

        Device.__init__(self)
Пример #5
0
    def __init__(self):

        self.__tv_dom = None
    
        Device.__init__(self)

        if (os.path.exists(_WORLDTV_XML)):
            xmlfile = _WORLDTV_XML
        else:
            xmlfile = gconf.client_get_default().get_string(_GCONF_KEY)

        if (xmlfile and os.path.exists(xmlfile)):
            try:
                data = open(xmlfile).read()
                self.__tv_dom = MiniXML(data).get_dom()
            except:
                pass
Пример #6
0
    def __init__(self, descr):
        """
        Builds a new UPnP device object from the given description URL.
        """

        self.__description = descr
        self.__icon = theme.mb_folder_upnp_mediaserver.get_path()
    
        dtype = descr.get_device_type()
        if (dtype == "urn:schemas-upnp-org:device:MediaServer:1"):
            svc = _SERVICE_CONTENT_DIRECTORY_1
        elif (dtype == "urn:schemas-upnp-org:device:MediaServer:2"):
            svc = _SERVICE_CONTENT_DIRECTORY_2
        else:
            svc = None

        if (svc):
            try:
                self.__cds_proxy = descr.get_service_proxy(svc)
            except KeyError:
                self.__cds_proxy = None

        Device.__init__(self)

        # try to retrieve device icon
        self.__retrieve_icon()

        # create cache if it does not exist yet
        if (not os.path.exists(_CACHE_DIR)):        
            try:
                os.makedirs(_CACHE_DIR)
            except:
                pass

        # clear cache of old files from previous sessions
        else:
            old_files = [ os.path.join(_CACHE_DIR, f)
                          for f in os.listdir(_CACHE_DIR)
                          if os.path.getmtime(os.path.join(_CACHE_DIR, f)) <
                             values.START_TIME ]
            for f in old_files:
                try:
                    os.unlink(f)
                except:
                    pass
Пример #7
0
    def __init__(self):

        self.__initialized = False

        # table: id -> device
        self.__devices = {}

        # list of favorited files
        self.__favorites = []

        # a small cache for faster access
        self.__cache = []

        # table: type -> list of devices
        self.__device_lists = {
            Device.TYPE_SYSTEM: [],
            Device.TYPE_GENERIC: [],
            Device.TYPE_AUDIO: [],
            Device.TYPE_VIDEO: [],
            Device.TYPE_IMAGE: []
        }

        Device.__init__(self)
Пример #8
0
 def __init__(self):
     
     self.__devices = [IRadioStorage(), ShoutcastStorage()]
     
     Device.__init__(self)
Пример #9
0
    def __init__(self):
    

        Device.__init__(self)
Пример #10
0
    def __init__(self):

        # genre list
        self.__genres = []

        Device.__init__(self)
Пример #11
0
    def __init__(self):

        # history of visited folders
        self.__history = []

        Device.__init__(self)
Пример #12
0
    def __init__(self):

        # table: id -> device
        self.__devices = {}

        Device.__init__(self)
Пример #13
0
    def __init__(self, label, path):

        self.__name = "[VCD] " + label
        self.__path = path

        Device.__init__(self)
Пример #14
0
    def __init__(self):

        self.__cache = []
        Device.__init__(self)
Пример #15
0
 def __init__(self):
 
     self.__stations = inetstations.get_stations()
 
     Device.__init__(self)