def main(): from conf import config config.update("example_config") app = QApplication(sys.argv) ba = ButtonArea(config.LABELS, config.HOTKEYS) ba.show() return app.exec_()
def cmd(args): ## Control Flow # TODO This should be done without if blocks. Maybe just call the 3-tuple. # Scan if args.cmd == 'database' or args.cmd == 'db': config.update('DATABASE', args.switch) if args.cmd == 'switch' or args.cmd == 'sw': config.update('COLLECTION', args.collection) if args.cmd == 'scan' or args.cmd == 'sc': if not args.nmap: resp = vuln_scan(args.range) elif args.nmap and args.range: resp = vuln_scan(args.range, args.nmap) elif args.nmap and args.list: resp = vuln_scan(args.list, args.nmap, mode=1) # Query elif args.cmd == 'query' or args.cmd == 'q': resp = query(args.expression) # Get elif args.cmd == 'get' or args.cmd == 'g': if not args.raw: resp = find(args.type, mode=0) else: resp = find(args.type, mode=1) # Find elif args.cmd == 'find' or args.cmd == 'f': resp = find(args.string) elif args.cmd == 'node' or args.cmd == 'n': resp = node(args.key) else: resp = "oops." return resp