def execute(self): KRun.runCommand(self.command_string, None)
def mouseDoubleClickEvent(self, event): KRun.runCommand(self.item.command, None)
CheckArguments(1) app = KApplication() command = args.arg(0).toLocal8Bit() if command == "properties": CheckArguments(2) fileList = [] for index in range(1, args.count()): fileList.append(KFileItem(args.url(index), "", 0)) propertiesDialog = KPropertiesDialog(KFileItemList(fileList)) propertiesDialog.exec_() elif command == "openwith": CheckArguments(2) fileList = [] for index in range(1, args.count()): fileList.append(args.url(index)) fileList = KUrl.List(fileList) propertiesDialog = KOpenWithDialog(fileList) if propertiesDialog.exec_(): service = propertiesDialog.service() if service == None: print("No service set, running " + propertiesDialog.text() + "\n") service = KService(propertiesDialog.text(), propertiesDialog.text(), "") KRun.run(service, fileList, None) else: Help()
args = KCmdLineArgs.parsedArgs() CheckArguments(1) app = KApplication() command = args.arg(0).toLocal8Bit(); if command == "properties": CheckArguments(2) fileList = [] for index in range(1, args.count()): fileList.append(KFileItem(args.url(index), "", 0)) propertiesDialog = KPropertiesDialog(KFileItemList(fileList)); propertiesDialog.exec_() elif command == "openwith": CheckArguments(2) fileList = [] for index in range(1, args.count()): fileList.append(args.url(index)) fileList = KUrl.List(fileList) propertiesDialog = KOpenWithDialog(fileList) if propertiesDialog.exec_(): service = propertiesDialog.service() if service == None: print("No service set, running " + propertiesDialog.text() + "\n") service = KService(propertiesDialog.text(), propertiesDialog.text(), "") KRun.run(service, fileList, None) else: Help()