예제 #1
0
    def on_added(self):
        s = Synaptic()
        packages = ['gnome-bluetooth', 'obexserver', 'bluez-utils']

        def install_packages():
            if s.install(packages):
                os.system('gnome-obex-server &')
                open_scan()

        def open_scan():
            os.system('gnome-bluetooth-manager &')

        if s.check(packages):
            os.system('gnome-obex-server &')
            actions = {_("Open Bluetooth manager"): open_scan}
        else:
            actions = {_("Install required packages"): install_packages}

        if self.properties.has_key('bluetooth_hci.interface_name'):
            interface = ': ' + self.properties['bluetooth_hci.interface_name']
        else:
            interface = ''
        print self.msg_render
        self.msg_render.show(_("BLUETOOTH"), 
             _("New Bluetooth interface configured ") + str(interface) +
             '.',
             BLUEICON, actions = actions)
예제 #2
0
    def on_added(self):
        s = Synaptic()
        packages = ['gnome-bluetooth', 'obexserver', 'bluez-utils']

        def install_packages():
            if s.install(packages):
                os.system('gnome-obex-server &')
                open_scan()

        def open_scan():
            os.system('gnome-bluetooth-manager &')

        if s.check(packages):
            os.system('gnome-obex-server &')
            actions = {"Abrir el administrador bluetooth": open_scan}
        else:
            actions = {"Instalar los paquetes necesarios": install_packages}

        if self.properties.has_key('bluetooth_hci.interface_name'):
            interface = ': ' + self.properties['bluetooth_hci.interface_name']
        else:
            interface = ''
        print self.msg_render
        self.msg_render.show("BLUETOOTH",
                             "Nueva interfaz bluetooth configurada " +
                             str(interface) + '.',
                             BLUEICON,
                             actions=actions)
예제 #3
0
    def on_added(self):
        s = Synaptic()
        packages = ['gnome-bluetooth', 'obexserver', 'bluez-utils']

        def install_packages():
            if s.install(packages):
                os.system('gnome-obex-server &')
                open_scan()

        def open_scan():
            os.system('gnome-bluetooth-manager &')

        if s.check(packages):
            os.system('gnome-obex-server &')
            actions = {"Abrir el administrador bluetooth": open_scan}
        else:
            actions = {"Instalar los paquetes necesarios": install_packages}

        if self.properties.has_key('bluetooth_hci.interface_name'):
            interface = ': ' + self.properties['bluetooth_hci.interface_name']
        else:
            interface = ''
        print self.msg_render
        self.msg_render.show("BLUETOOTH", 
             "Nueva interfaz bluetooth configurada " + str(interface) +
             '.',
             BLUEICON, actions = actions)
    def on_added(self):
        s = Synaptic()
        packages = ["pcscd", "pcsc-tools", "libccid"]

        def install_packages():
            s.install(packages)

        if s.check(packages):
            self.msg_render.show(_("C3PO"), _("Card reader detected"), C3POICON)
        else:
            actions = {_("Install required packages"): install_packages}
            self.msg_render.show(_("C3PO"), _("Card reader detected"), C3POICON, actions=actions)
예제 #5
0
    def hack(self, volume_actor):
        """
        <volume_actor> must be a volume.Actor object
        """

        self.volume_actor = volume_actor
        s = Synaptic()
        mountpoint = self.volume_actor.properties['volume.mount_point']

        def action_install_gai():
            s.install(GAIPACKAGES)
            self.show_supplement_info()

        def action_install_sup():
            os.system('gksudo guadalinex-app-install %s' %\
                    mountpoint)

        #Check for label and  README.diskdefines
        volumelabel = self.volume_actor.properties['volume.label']
        if self.__is_valid(volumelabel):
            s = Synaptic()
            actions = {}
            suppc = SupplementCustomizer(mountpoint)
            diskdefines = suppc.get_diskdefines()
            if diskdefines:
                #Check for required packages
                if s.check(GAIPACKAGES):
                    actions = {
                        "Instalar Suplemento": action_install_sup
                    }
                else:
                    actions = {
                        "Instalar herramientas para suplementos" : action_install_gai
                        }

                diskname = ''
                for key, value in diskdefines:
                    if key == 'DISKNAME':
                        diskname = value
                        break;

                message  = diskname
                summary = "Guadalinex Suplementos"
                iconpath = mountpoint + '/' + RELATIVEICONPATH
                if os.path.isfile(iconpath):
                    self.volume_actor.msg_render.show(summary, message, 
                            icon = iconpath, actions = actions)

                else:
                    self.volume_actor.msg_render.show_info(summary, message,
                            actions = actions)
    def on_added(self):
        s = Synaptic()
        packages = ['pcscd', 'pcsc-tools', 'libccid']

        def install_packages():
            s.install(packages)

        if s.check(packages):
            self.msg_render.show("C3PO", 
                    "Lector de tarjetas detectado",
                    C3POICON)
        else:
            actions = {"Instalar los paquetes necesarios": install_packages}
            self.msg_render.show("C3PO", "Lector de tarjetas detectado", 
                    C3POICON,
                    actions = actions)
예제 #7
0
    def on_added(self):
        s = Synaptic()
        packages = ['pcscd', 'pcsc-tools', 'libccid']

        def install_packages():
            s.install(packages)

        if s.check(packages):
            self.msg_render.show("C3PO", "Lector de tarjetas detectado",
                                 C3POICON)
        else:
            actions = {"Instalar los paquetes necesarios": install_packages}
            self.msg_render.show("C3PO",
                                 "Lector de tarjetas detectado",
                                 C3POICON,
                                 actions=actions)
예제 #8
0
    def on_added(self):
        s = Synaptic()
        packages = ['pcscd', 'pcsc-tools', 'libccid']

        def install_packages():
            s.install(packages)

        if s.check(packages):
            self.msg_render.show(_("C3PO"), 
                    _("Card reader detected"),
                    C3POICON)
        else:
            actions = {_("Install required packages"): install_packages}
            self.msg_render.show(_("C3PO"), _("Card reader detected"), 
                    C3POICON,
                    actions = actions)
예제 #9
0
    def on_added(self):
        s = Synaptic()
        packages = ['gthumb']

        def install_packages():
            s.install(packages)
            open_gthumb()

        def open_gthumb():
            os.system('gthumb --import-photos &')

        if s.check(packages):
            actions = {}
        else:
            actions = {_("Install required packages"): install_packages}

        self.msg_render.show(_("CAMERA"), 
             _("Digital camera connected."),
             CAMERAICON, actions = actions)
예제 #10
0
    def on_added(self):
        s = Synaptic()
        packages = ['gtkpod']

        def install_packages():
            if s.install(packages):
                open_gtkpod()

        def open_gtkpod():
            os.system('gtkpod &')

        if s.check(packages):
            actions = {_("Open iPod Manager"): open_gtkpod}
        else:
            actions = {_("Install required packages"): install_packages}

        self.msg_render.show(_("iPod"), 
             _("iPod device detected"),
             ICON, actions = actions)
예제 #11
0
    def on_added(self):
        s = Synaptic()
        packages = ['gthumb']

        def install_packages():
            s.install(packages)
            open_gthumb()

        def open_gthumb():
            os.system('gthumb --import-photos &')

        if s.check(packages):
            actions = {}
        else:
            actions = {"Instalar los paquetes necesarios": install_packages}

        self.msg_render.show("CAMARA", 
             "Cámara digital conectada.",
             CAMERAICON, actions = actions)
예제 #12
0
    def on_added(self):
        s = Synaptic()
        packages = ['gtkpod']

        def install_packages():
            if s.install(packages):
                open_gtkpod()

        def open_gtkpod():
            os.system('gtkpod &')

        if s.check(packages):
            actions = {"Abrir administrador iPod": open_gtkpod}
        else:
            actions = {"Instalar los paquetes necesarios": install_packages}

        self.msg_render.show("iPod", 
             "Dispositivo iPod detectado",
             ICON, actions = actions)
예제 #13
0
    def on_added(self):
        s = Synaptic()
        packages = ['gtkpod']

        def install_packages():
            if s.install(packages):
                open_gtkpod()

        def open_gtkpod():
            os.system('gtkpod &')

        if s.check(packages):
            actions = {"Abrir administrador iPod": open_gtkpod}
        else:
            actions = {"Instalar los paquetes necesarios": install_packages}

        self.msg_render.show("iPod",
                             "Dispositivo iPod detectado",
                             ICON,
                             actions=actions)
예제 #14
0
    def on_added(self):
        s = Synaptic()
        packages = ['gthumb']

        def install_packages():
            s.install(packages)
            open_gthumb()

        def open_gthumb():
            os.system('gthumb --import-photos &')

        if s.check(packages):
            actions = {}
        else:
            actions = {_("Install required packages"): install_packages}

        self.msg_render.show(_("CAMERA"),
                             _("Digital camera connected."),
                             CAMERAICON,
                             actions=actions)
예제 #15
0
    def on_added(self):
        s = Synaptic()
        packages = ['gtkpod']

        def install_packages():
            if s.install(packages):
                open_gtkpod()

        def open_gtkpod():
            os.system('gtkpod &')

        if s.check(packages):
            actions = {_("Open iPod Manager"): open_gtkpod}
        else:
            actions = {_("Install required packages"): install_packages}

        self.msg_render.show(_("iPod"),
                             _("iPod device detected"),
                             ICON,
                             actions=actions)
예제 #16
0
    def on_added(self):
        s = Synaptic()
        packages = ['guadalinex-noodle']

        def install_packages():
            if s.install(packages):
                os.system('psuite-user')
        def open_multisync():
		os.system('multisync')

        if s.check(packages):
            os.system('psuite-user &')
            actions = {"Abrir el administrador de sincronización": open_multisync}
        else:
            actions = {"Instalar los paquetes necesarios": install_packages}

        print self.msg_render
        self.msg_render.show("PDA", 
             "Nuevo dispositivo PDA configurado " +
             '.',
             WMEICON, actions = actions)
예제 #17
0
    def hack_on_added(self, usb_actor):
        "usbdevice.Actor.on_added hack"
        assert(isinstance(usb_actor, Actor))

        def run_xsane():
            os.system('xsane & ')

        def install_packages():
            synaptic.install(UsbScannerActorHack.PACKAGES)
            run_xsane()

        synaptic = Synaptic()

        actions = {}
        if synaptic.check(UsbScannerActorHack.PACKAGES):
            actions = {_("Run rendering program"): run_xsane}
        else:
            actions = {_("Install required packages"): install_packages}

        usb_actor.msg_render.show(_("SCANNER"), _("Scanner device detected"),
                                SCANNERICON, actions = actions)
예제 #18
0
    def hack_on_added(self, usb_actor):
        "usbdevice.Actor.on_added hack"
        assert(isinstance(usb_actor, Actor))

        def run_xsane():
            os.system('xsane & ')

        def install_packages():
            synaptic.install(UsbScannerActorHack.PACKAGES)
            run_xsane()

        synaptic = Synaptic()

        actions = {}
        if synaptic.check(UsbScannerActorHack.PACKAGES):
            actions = {"Ejecutar programa de digitalización": run_xsane}
        else:
            actions = {"Instalar el software necesario": install_packages}

        usb_actor.msg_render.show("ESCÁNER", "Dispositivo escáner detectado",
                                SCANNERICON, actions = actions)
예제 #19
0
    def on_added(self):
        s = Synaptic()
        packages = ['gnome-cups-manager']

        def install_packages():
            if get_sudo():
                s.install(packages)
                open_printer_dialog()

        def open_printer_dialog():
            if get_sudo():
                os.system('sudo /etc/init.d/cupsys restart')
                time.sleep(1)
                os.system('sudo gnome-cups-add &')

        if s.check(packages):
            actions = {"Añadir": open_printer_dialog}
        else:
            actions = {"Instalar los paquetes necesarios": install_packages}

        self.msg_render.show("IMPRESORA", "Impresora detectada",
             PRINTERICON, actions = actions)
예제 #20
0
    def on_added(self):
        s = Synaptic()
        packages = ['gnome-cups-manager']

        def install_packages():
            if get_sudo():
                s.install(packages)
                open_printer_dialog()

        def open_printer_dialog():
            if get_sudo():
                os.system('sudo /etc/init.d/cupsys restart')
                time.sleep(1)
                os.system('sudo gnome-cups-add &')

        if s.check(packages):
            actions = {_("Add"): open_printer_dialog}
        else:
            actions = {_("Install required packages"): install_packages}

        self.msg_render.show(_("PRINTER"), _("Printer detected"),
             PRINTERICON, actions = actions)
예제 #21
0
    def hack_on_added(self, usb_actor):
        "usbdevice.Actor.on_added hack"
        usb_actor.logger.debug("UsbWebcamActorHack: hack_on_added")
        assert(isinstance(usb_actor, Actor))

        def run_camorama():
            os.system('camorama & ')

        def install_packages():
            synaptic.install(UsbWebcamActorHack.PACKAGES)
            run_camorama()

        synaptic = Synaptic()

        actions = {}
        if synaptic.check(UsbWebcamActorHack.PACKAGES):
            actions = {"Ejecutar programa de captura": run_camorama}
        else:
            actions = {"Instalar el software necesario": install_packages}

        usb_actor.msg_render.show("WEBCAM", "Webcam detectada",
                                WEBCAMICON, actions = actions)
예제 #22
0
    def hack_on_added(self, usb_actor):
        "usbdevice.Actor.on_added hack"
        usb_actor.logger.debug("UsbWebcamActorHack: hack_on_added")
        assert(isinstance(usb_actor, Actor))

        def run_camorama():
            os.system('camorama & ')

        def install_packages():
            synaptic.install(UsbWebcamActorHack.PACKAGES)
            run_camorama()

        synaptic = Synaptic()

        actions = {}
        if synaptic.check(UsbWebcamActorHack.PACKAGES):
            actions = {_("Run capture program"): run_camorama}
        else:
            actions = {_("Install required packages"): install_packages}

        usb_actor.msg_render.show(_("WEBCAM"), _("Webcam detected"),
                                WEBCAMICON, actions = actions)
예제 #23
0
    def hack_on_added(self, usb_actor):
        "usbdevice.Actor.on_added hack"
        usb_actor.logger.debug("UsbWebcamActorHack: hack_on_added")
        assert(isinstance(usb_actor, Actor))

        def run_camorama():
            os.system('camorama & ')

        def install_packages():
            synaptic.install(UsbWebcamActorHack.PACKAGES)
            run_camorama()

        synaptic = Synaptic()

        actions = {}
        if synaptic.check(UsbWebcamActorHack.PACKAGES):
            actions = {_("Run capture program"): run_camorama}
        else:
            actions = {_("Install required packages"): install_packages}

        usb_actor.msg_render.show(_("WEBCAM"), _("Webcam detected"),
                                WEBCAMICON, actions = actions)
예제 #24
0
    def hack_on_added(self, usb_actor):
        "usbdevice.Actor.on_added hack"
        assert (isinstance(usb_actor, Actor))

        def run_xsane():
            os.system('xsane & ')

        def install_packages():
            synaptic.install(UsbScannerActorHack.PACKAGES)
            run_xsane()

        synaptic = Synaptic()

        actions = {}
        if synaptic.check(UsbScannerActorHack.PACKAGES):
            actions = {_("Run rendering program"): run_xsane}
        else:
            actions = {_("Install required packages"): install_packages}

        usb_actor.msg_render.show(_("SCANNER"),
                                  _("Scanner device detected"),
                                  SCANNERICON,
                                  actions=actions)
예제 #25
0
    def on_added(self):
        s = Synaptic()
        packages = ['gnome-cups-manager']

        def install_packages():
            if get_sudo():
                s.install(packages)
                open_printer_dialog()

        def open_printer_dialog():
            if get_sudo():
                os.system('sudo /etc/init.d/cupsys restart')
                time.sleep(1)
                os.system('sudo gnome-cups-add &')

        if s.check(packages):
            actions = {_("Add"): open_printer_dialog}
        else:
            actions = {_("Install required packages"): install_packages}

        self.msg_render.show(_("PRINTER"),
                             _("Printer detected"),
                             PRINTERICON,
                             actions=actions)
예제 #26
0
    def on_added(self):
        s = Synaptic()
        packages = ['guadalinex-noodle']

        def install_packages():
            if s.install(packages):
                os.system('psuite-user')

        def open_multisync():
            os.system('multisync')

        if s.check(packages):
            os.system('psuite-user &')
            actions = {
                "Abrir el administrador de sincronización": open_multisync
            }
        else:
            actions = {"Instalar los paquetes necesarios": install_packages}

        print self.msg_render
        self.msg_render.show("PDA",
                             "Nuevo dispositivo PDA configurado " + '.',
                             WMEICON,
                             actions=actions)
예제 #27
0
    def on_added(self):
        s = Synaptic()
        packages = ['gnome-cups-manager']

        def install_packages():
            if get_sudo():
                s.install(packages)
                open_printer_dialog()

        def open_printer_dialog():
            if get_sudo():
                os.system('sudo /etc/init.d/cupsys restart')
                time.sleep(1)
                os.system('sudo gnome-cups-add &')

        if s.check(packages):
            actions = {"Añadir": open_printer_dialog}
        else:
            actions = {"Instalar los paquetes necesarios": install_packages}

        self.msg_render.show("IMPRESORA",
                             "Impresora detectada",
                             PRINTERICON,
                             actions=actions)