def getSearch(request, response): nsp = [] nsx = [] nsz = [] xci = [] xcz = [] nut_impl.scan() for _, f in nsps.files.items(): name = f.fileName() if name.endswith('.nsp'): nsp.append({ 'id': f.titleId, 'name': f.fileName(), 'version': int(f.version) if f.version else None }) elif name.endswith('.nsz'): nsz.append({ 'id': f.titleId, 'name': f.fileName(), 'version': int(f.version) if f.version else None }) elif name.endswith('.nsx'): nsx.append({ 'id': f.titleId, 'name': f.fileName(), 'version': int(f.version) if f.version else None }) elif name.endswith('.xci'): xci.append({ 'id': f.titleId, 'name': f.fileName(), 'version': int(f.version) if f.version else None }) elif name.endswith('.xcz'): xcz.append({ 'id': f.titleId, 'name': f.fileName(), 'version': int(f.version) if f.version else None }) o = nsz + nsp + xcz + xci + nsx response.write(json.dumps(o))
def getScan(request, response): success(request, response, nut_impl.scan())
def on_scan(self): self.tableWidget.setRowCount(0) nut_impl.scan() self.refreshTable()
def initThread(app): nut_impl.scan() app.refresh()
printer.info(' ,;:;;,') printer.info(' ;;;;;') printer.info(' .=\', ;:;;:,') printer.info(' /_\', "=. \';:;:;') printer.info(' @=:__, \\,;:;:\'') printer.info(' _(\\.= ;:;;\'') printer.info(' `"_( _/="`') printer.info(' `"\'') if args.usb: try: from nut_impl import usb except BaseException as e: printer.error('pip3 install pyusb, required for USB coms: ' + f'{str(e)}') nut_impl.scan() usb.daemon() if args.server: nut_impl.initFiles() nut_impl.scan() server.run() if len(sys.argv) == 1: import nut_gui nut_gui.run() status.close() except KeyboardInterrupt: config.isRunning = False