def on_btnBuildIso_clicked(self, widget): selected = self.tvHandlerDistros.getToggledValues(toggleColNr=0, valueColNr=2) msg = "" for path in selected: self.toggleGuiElements(True) self.showOutput("Start building ISO in: %s" % path) repaintGui() # Start building the ISO in a thread t = BuildIso(path, self.queue) t.start() self.queue.join() # Thread is done # Get the data from the queue ret = self.queue.get() self.queue.task_done() if ret is not None: self.showOutput(ret) if "error" in ret.lower(): self.showError("Error", ret, self.window) else: msg += "%s\n" % ret if msg != "": if exists("/usr/bin/aplay") and exists(self.doneWav): self.ec.run("/usr/bin/aplay '%s'" % self.doneWav, False) self.showInfo("", msg, self.window) self.toggleGuiElements(False)
def main(self, argv): # Handle arguments try: opts, args = getopt.getopt(argv, 'ic:dl:', ['install', 'codes=', 'debug', 'log']) except getopt.GetoptError: usage() sys.exit(2) for opt, arg in opts: if opt in ('-d', '--debug'): self.debug = True elif opt in ('-i', '--install'): self.install = True elif opt in ('-c', '--codes'): self.hwPreSelectList = arg.split(',') elif opt in ('-l', '--log'): self.logPath = arg # Initialize logging logFile = '' if self.debug: if self.logPath == '': self.logPath = 'ddm.log' self.log = Logger(self.logPath, 'debug', True, self.statusbar) functions.log = self.log # Set initial values self.text = self.conf.getValue('About', 'comments') self.lblText.set_text(self.text) # Show message that we're busy self.btnInstall.set_sensitive(False) self.btnRemove.set_sensitive(False) msg = 'Checking your hardware...' self.log.write(msg, 'ddm.main', 'info') functions.pushMessage(self.statusbar, msg) functions.repaintGui() # Fill hardware list self.fillHardware() self.btnInstall.set_sensitive(True) self.btnRemove.set_sensitive(True) # Show version number in status bar functions.pushMessage(self.statusbar, self.version) # Start automatic install if self.install: self.log.write('Start automatic driver install', 'ddm.main', 'info') self.installHardware(None) # Show window gtk.main()
def main(self, argv): # Handle arguments try: opts, args = getopt.getopt(argv, 'ic:dfl:', ['install', 'codes=', 'debug', 'force', 'log=']) except getopt.GetoptError: print 'Arguments cannot be parsed: ' + str(argv) sys.exit(2) for opt, arg in opts: if opt in ('-d', '--debug'): self.debug = True elif opt in ('-i', '--install'): self.install = True elif opt in ('-c', '--codes'): self.hwPreSelectList = arg.split(',') elif opt in ('-l', '--log'): self.logPath = arg # Initialize logging if self.debug: if self.logPath == '': self.logPath = 'ddm.log' self.log = Logger(self.logPath, 'debug', True, self.statusbar, self.window) functions.log = self.log # Set initial values self.lblText.set_text('Currently Nvidia, ATI and Broadcom drivers are supported and it detects multi-core 32-bit systems so that the PAE kernel can be installed.') # Show message that we're busy self.btnInstall.set_sensitive(False) self.btnRemove.set_sensitive(False) msg = 'Checking your hardware...' self.log.write(msg, 'ddm.main', 'info') functions.pushMessage(self.statusbar, msg) functions.repaintGui() # Fill hardware list self.fillHardware() self.btnInstall.set_sensitive(True) self.btnRemove.set_sensitive(True) # Show version number in status bar self.version = functions.getPackageVersion('device-driver-manager') functions.pushMessage(self.statusbar, self.version) # Start automatic install if self.install: self.log.write('Start automatic driver install', 'ddm.main', 'info') self.installHardware(None) # Show window and keep it on top of other windows self.window.set_keep_above(True) gtk.main()
def on_btnEdit_clicked(self, widget): selected = self.tvHandlerDistros.getToggledValues(toggleColNr=0, valueColNr=2) for path in selected: de = EditDistro(path) services = [] if exists(join(path, 'root/etc/apache2/apache2.conf')): services.append("apache2") if exists(join(path, 'root/etc/mysql/debian.cnf')): services.append("mysql") if services: msg = "If you need to update packages that depend on these services,\n" \ "you will need to manually start them:\n" for service in services: msg += "\nservice %s start" % service msg += "\n\nWhen done:\n" for service in services: msg += "\nservice %s stop" % service self.showInfo(_("Services detected"), msg, self.window) repaintGui() de.openTerminal()
shutil.copy2(template, conkyStart) functions.chownCurUsr(conkyStart) functions.makeExecutable(conkyStart) else: functions.log("ERROR: Conky-start not found: %s" % template) sys.exit(2) # ===================================================================== # Check hardware and adapt configs accordingly # ===================================================================== # Get bandwidth speed estimate dload = 1024 qd = QuestionDialog(title, "Do you want to test your download speed?\n\nA 10MB file is going to be downloaded.\nDefault is set to 1MB.") answer = qd.show() if answer: functions.repaintGui() dload = int(functions.getBandwidthSpeed()) if dload <= 1024: dload = 1024 functions.log("Default speed selected: %d" % dload) else: dload *= 5 #uload = int(dload / 10) functions.replaceStringInFile('\[DSPEED\]', str(dload), lua) functions.replaceStringInFile('\[USPEED\]', str(dload), lua) # Network interface functions.log('=============================================') interface = functions.getNetworkInterface() functions.log('=============================================')