예제 #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 get_file_actions(self, folder, f):

        actions = Device.get_file_actions(self, folder, f)
        if (f.mimetype != f.DIRECTORY):
            actions.append((None, "Download", self.__on_download))

        return actions
예제 #6
0
    def get_file_actions(self, folder, f):

        options = Device.get_file_actions(self, folder, f)
        options.append(
            (None, "Add to my Internet Radios", self.__on_add_radio))

        return options
예제 #7
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
예제 #8
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
예제 #9
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)
예제 #10
0
    def __init__(self):

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

        Device.__init__(self)
예제 #11
0
    def get_bulk_actions(self, folder):

        options = Device.get_bulk_actions(self, folder)
        options.append((None, "Delete Stations", self.__on_delete_item))

        return options
예제 #12
0
    def __init__(self):
    

        Device.__init__(self)
예제 #13
0
    def __init__(self):

        self.__cache = []
        Device.__init__(self)
예제 #14
0
    def get_file_actions(self, folder, f):

        actions = Device.get_file_actions(self, folder, f)
        actions.append((None, "Download", self.__on_download))

        return actions
예제 #15
0
 def __init__(self):
 
     self.__stations = inetstations.get_stations()
 
     Device.__init__(self)
예제 #16
0
    def __init__(self):

        # history of visited folders
        self.__history = []

        Device.__init__(self)
예제 #17
0
    def __init__(self):

        # genre list
        self.__genres = []

        Device.__init__(self)
예제 #18
0
    def __init__(self, label, path):

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

        Device.__init__(self)
예제 #19
0
 def __init__(self):
     
     self.__devices = [IRadioStorage(), ShoutcastStorage()]
     
     Device.__init__(self)
예제 #20
0
    def get_file_actions(self, folder, f):
    
        options = Device.get_file_actions(self, folder, f)
        options.append((None, "Delete Station", self.__on_delete_item))

        return options