def on_switch_changed(self,switch,state,reponame):
     if state:
         check = runinroot.call("dnf config-manager --set-enable "+reponame)
         if check!=0:
             switch.handler_block_by_func(self.on_switch_changed)
             switch.set_active(False)
             switch.handler_unblock_by_func(self.on_switch_changed)
             return True
                 
     else :
         check = runinroot.call("dnf config-manager --set-disable "+reponame)
         if check!=0:
             switch.handler_block_by_func(self.on_switch_changed)
             switch.set_active(True)
             switch.handler_unblock_by_func(self.on_switch_changed)
             return True
 def run(self):
     GLib.idle_add(self.parent.set_sensitive,False)
     GLib.idle_add(self.spinner.start)
     check = runinroot.call("cp {} /etc/default/grub && /usr/sbin/grub-mkconfig -o /boot/grub/grub.cfg".format(self.file_))
     GLib.idle_add(self.parent.set_sensitive,True)
     GLib.idle_add(self.spinner.stop)
     GLib.idle_add(self.refresh_func)
示例#3
0
 def run(self):
     GLib.idle_add(self.parent.set_sensitive, False)
     GLib.idle_add(self.spinner.start)
     grubmenuconfig = fedora_get_grub_menufile()
     check = runinroot.call(
         "cp {} /etc/default/grub && /usr/sbin/grub2-mkconfig -o  {}".
         format(self.file_, grubmenuconfig))
     GLib.idle_add(self.parent.set_sensitive, True)
     GLib.idle_add(self.spinner.stop)
     GLib.idle_add(self.refresh_func)
 def install_remove(self,command,status,wireless):
     GLib.idle_add(self.spinner.start)
     GLib.idle_add(self.statuslabel.set_label,_("<b>Please Wait</b>"))
     d = installrpmfusion()
     if d!=0 :
         GLib.idle_add(self.statuslabel.set_label,_("<b>Install Rpmfusion Repos Fail</b>"))
         self.run_refresh_drivers()
         return
     out = runinroot.call(command,timeout=1000000)
     if out==0:
         if wireless and status=="i":
             networkmanager = NetworkManager()
             for interface in networkmanager.getAllWirelessInterfaceNAME():
                 runinroot.call("firewall-cmd --zone=$(firewall-cmd --get-default-zone) --permanent --add-interface="+interface,timeout=1000000)
                 time.sleep(1)
         GLib.idle_add(self.statuslabel.set_label,_("<b>Success Restart System</b>"))
     else:
         GLib.idle_add(self.statuslabel.set_label,_("<b>Fail</b>"))
     self.run_refresh_drivers()
示例#5
0
def onlyinstallrpmfusion():
    return  runinroot.call("dnf install -y  --nogpgcheck --best http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm")