示例#1
0
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))
示例#2
0
def getScan(request, response):
    success(request, response, nut_impl.scan())
示例#3
0
 def on_scan(self):
     self.tableWidget.setRowCount(0)
     nut_impl.scan()
     self.refreshTable()
示例#4
0
def initThread(app):
    nut_impl.scan()
    app.refresh()
示例#5
0
文件: nut.py 项目: angelwarwick/nut
        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