Beispiel #1
0
    def on_removed(self):
        if self.sound[0] == "on": 
            self.cmdaction="%s %s" %(self.config["config.sound.exec"],self.config["config.sound.removed"])
            self.cmd_exec()
        for app in self.exeun:
            print "   Execun: %s" % app
            self.cmdaction=app
            self.cmd_exec()
        for unotify_list in self.unotify:
            icon=IconPath(unotify_list[ICON].strip())
            if icon.icon_path == None:
                icon.icon_path = "gtk-dialog-info"
            
            # print messages
            print "   %s: %s" % ("Icon",icon.icon_path)
            print "   %s: %s" % ("Summary",unotify_list[SUMMARY])
            print "   %s: %s" % ("Body",unotify_list[MESSAGE] )

            self.msg_render.show(unotify_list[SUMMARY],
                        unotify_list[MESSAGE],
                        icon.icon_path,
                        coordinates=self.coordinates
                        )
        for app in self.voiceun:
            print "   Say: %s" % app
            self.cmdaction=app
            self.cmd_exec()       
Beispiel #2
0
    def on_added(self):
        #print "on_added"
        if self.sound[0] == 'on': 
            self.cmdaction="%s %s" %(self.config["config.sound.exec"],self.config["config.sound.added"])
            self.cmd_exec()
       

        #this is just in case of mount=True
        # then PropertyChange signal occurs
        if self.mount == True:
            dev=self.properties["block.device"]
            summary=self.properties["info.product"]
            body="%s %s" % ("block device",dev)
            cmdmount="%s %s" % ("pmount",dev)
            straction="%s %s" % ("Mount",self.properties["info.category"])   
            self.cmdaction=cmdmount
            actions={straction: self.cmd_exec}

            if self.properties["volume.fstype"] == "iso9660":
                icon=IconPath(self.config["config.icon.cdrom"]).icon_path
            else:
                icon=IconPath(self.config["config.icon.harddisk"]).icon_path
            #print "   %s: %s" % ("Icon",str(icon))
            #print "   %s: %s" % ("Sound",self.sound)
            #print "   %s: %s" % ("Summary",str(summary))
            #print "   %s: %s" % ("Body",str(body))
            #print "   %s: %s" % ("Action",cmdmount) 

            self.msg_render.show(summary,body,actions=actions,icon=icon,expires=0,coordinates=self.coordinates)
            for app in self.voice:
                #print "   Say: %s" % app
                self.voicesay=app
                self.voice_exec()   
            
        else:
            for app in self.exe:
                #print "   Exec: %s" % app
                self.cmdaction=app
                self.cmd_exec() 

        for notify_list in self.notify:
            icon=IconPath(notify_list[ICON].strip())
            if icon.icon_path == None:
                icon.icon_path = "gtk-dialog-info"
            # print messages
            #print "   %s: %s" % ("Icon",icon.icon_path) 
            #print "   %s: %s" % ("Summary",notify_list[SUMMARY])
            print "   %s: %s" % ("Body",notify_list[MESSAGE])
            #print notify_list
            self.msg_render.show(notify_list[SUMMARY],
                        notify_list[MESSAGE],
                        icon.icon_path,
                        coordinates=self.coordinates
                        )