Ejemplo n.º 1
0
    def get_icon(self, icon_size=utils.DEFAULT_ICON_SIZE, flags=0):

        filename = self.get('Icon')

        if not os.path.exists(filename):
            filename = utils.get_theme_icon_path(filename, icon_size, flags)

        if filename == None:
            iclass = self.get_interface_class()
            filename = iclass.get_icon(icon_size, flags)
            if type(filename) == str and not os.path.exists(filename):
                filename = utils.get_theme_icon_path(filename, icon_size, flags)

        if filename == None:
            filename = utils.get_default_icon_interface()

        return filename
Ejemplo n.º 2
0
    def get_icon(self, icon_size=utils.DEFAULT_ICON_SIZE, flags=0):

        filename = self.get('Icon')

        if not os.path.exists(filename):
            filename = utils.get_theme_icon_path(filename, icon_size, flags)

        if filename == None:
            filename = utils.get_default_icon_action()

        return filename
Ejemplo n.º 3
0
 def get_icon(self, icon_size=utils.DEFAULT_ICON_SIZE, flag=0):
     if self.dev_udev.get_property('ICON'):
         filename = self.dev_udev.get_property('ICON')
         if not os.path.exists(filename):
             filename = utils.get_theme_icon_path(filename, icon_size, flag)
             return filename
         return filename
     num_interfaces = self.get_number_interfaces()
     if num_interfaces == 1:
         return self.get_interfaces()[0].get_interface_entry().get_icon(icon_size, flag)
     else:
         return utils.get_default_icon_device()
Ejemplo n.º 4
0
    def get_icon(self, icon_size=utils.DEFAULT_ICON_SIZE, flags=0):
        filename = None
        l_udev = self.client.query_by_subsystem('*')
        for udev_object in l_udev:
            if self.sysfspath + '/' in udev_object.get_sysfs_path():
                filename = udev_object.get_property('ICON')
                if filename:
                    if not os.path.exists(filename):
                        filename = utils.get_theme_icon_path(filename, icon_size, flags)
                    return filename

        return filename