How to use _format_help method in tox

Best Python code snippet using tox_python

parser.py

Source: parser.py Github

copy

Full Screen

...33 )34 parser.add_argument(35 '-t', '--target',36 dest='target', required=True,37 help=_format_help('Target domain/​rootdomain/​ip')38 )39 available_plugins = PluginController.get_available_plugins().keys()40 parser.add_argument(41 '-p', '--plugins', metavar='plugin',42 dest='plugins_specific', nargs='+', default=None,43 help=_format_help([44 'Specify the plugins',45 'avaliable: ' + '\n'.join([' '.join(available_plugins[i:i+3]) for i in range(0, len(available_plugins), 4)])46 ])47 )48 parser.add_argument(49 '-m', '--max_level', 50 dest='max_level', default=4,51 type=int, help=_format_help('Max level to get domain/​ip/​rootdomain')52 )53 parser.add_argument(54 '--pool_size', 55 dest='pool_size', type=int, default=500,56 help=_format_help('Max number of Thread pool size')57 )58 parser.add_argument(59 '-o', '--output_file',60 dest='output_file', default=None,61 help=_format_help('File to ouput result')62 )63 parser.add_argument(64 '--format',65 dest='output_format', default='csv',66 help=_format_help([67 'The format to output result,',68 'default list:',69 '/​'.join(Output.get_output_formats())70 ])71 )72 # Log73 parser.add_argument(74 '--log_file',75 dest='log_file', default=None,76 help=_format_help('Log file')77 )78 loglevel_choices = {79 1: 'DEBUG',80 2: 'INFO',81 3: 'WARNING',82 4: 'ERROR',83 }84 parser.add_argument(85 '--log_level',86 dest='log_level',87 type=int, default=1, choices=loglevel_choices,88 help=_format_help('Log level of output to file', loglevel_choices)89 )90 # Proxy91 parser.add_argument(92 '--proxy_file',93 dest='proxy_file', default=None,94 help=_format_help([95 'Proxy file, one line one proxy, each line format:',96 'schem,proxy url,',97 'eg:http,http:/​/​1.1.1.1:123',98 ])99 )100 parser.add_argument(101 '--verify_proxy',102 dest='verify_proxy', default=False, action='store_true',103 help=_format_help('If verify the proxy list')104 )105 parser.add_argument(106 '--timeout',107 dest='timeout', type=int, default=10,108 help=_format_help('Request timeout')109 )110 parser.add_argument(111 '--alive_check', 112 dest='alive_check', default=False, action='store_true',113 help=_format_help('Check alive and accessible status of domain')114 )115 args = parser.parse_args()116 return args.__dict__117def _format_help(help_info, choices=None):118 if isinstance(help_info, list):119 help_str_list = help_info[:]120 else:121 help_str_list = [help_info]122 if choices:123 help_str_list.extend([124 '%s%s - %s' % (INDENT, k, v) for k, v in choices.items()125 ])126 help_str_list.append(INDENT + '(DEFAULT: %(default)s)')...

Full Screen

Full Screen

parse.py

Source: parse.py Github

copy

Full Screen

...27 parser.add_argument('-V', '--version', action='version',28 version=VERSION_INFO)29 parser.add_argument(30 '-t', '--target', dest='target', required=True,31 help=_format_help('Target domain/​rootdomain/​ip')32 )33 available_plugins = PluginController.get_available_plugins().keys()34 parser.add_argument(35 '-p', '--plugins', metavar='plugin',36 dest='plugins_specific', nargs='+',37 default=None,38 help=_format_help([39 'Specify the plugins',40 'avaliable: '+' ,'.join(available_plugins),41 ])42 )43 parser.add_argument(44 '-m', '--max_level', dest='max_level', default=4,45 type=int, help=_format_help('Max level to get domain/​ip/​rootdomain')46 )47 parser.add_argument(48 '-o', '--output_file', dest='output_file',49 help=_format_help('File to ouput result')50 )51 parser.add_argument(52 '--format', dest='output_format', default='csv',53 help=_format_help([54 'The format to output result,',55 'default list:',56 Output.get_output_formats()57 ])58 )59 parser.add_argument(60 '--log_file', dest='log_file',61 help=_format_help('Log file')62 )63 loglevel_choices = {64 1: 'DEBUG',65 2: 'INFO',66 3: 'WARNING',67 4: 'ERROR',68 }69 parser.add_argument(70 '--log_level', dest='log_level',71 type=int, default=1, choices=loglevel_choices,72 help=_format_help('Log level of output to file', loglevel_choices)73 )74 parser.add_argument(75 '--proxy_file', dest='proxy_file',76 help=_format_help([77 'Proxy file, one line one proxy, each line format:',78 'schem,proxy url,',79 'eg:http,http:/​/​1.1.1.1:123',80 ])81 )82 parser.add_argument(83 '--verify_proxy', dest='verify_proxy', action='store_true',84 default=False,85 help=_format_help('If verify the proxy list')86 )87 parser.add_argument(88 '--timeout', dest='timeout',89 type=int, default=10,90 help=_format_help('Request timeout')91 )92 args = parser.parse_args(args)93 return args949596def _format_help(help_info, choices=None):97 if isinstance(help_info, list):98 help_str_list = help_info[:]99 else:100 help_str_list = [help_info]101102 if choices:103 help_str_list.extend([104 '%s%s - %s' % (INDENT, k, v) for k, v in choices.items()105 ])106107 help_str_list.append(INDENT + '(DEFAULT: %(default)s)')108 ...

Full Screen

Full Screen

Blogs

Check out the latest blogs from LambdaTest on this topic:

Assessing Risks in the Scrum Framework

Software Risk Management (SRM) combines a set of tools, processes, and methods for managing risks in the software development lifecycle. In SRM, we want to make informed decisions about what can go wrong at various levels within a company (e.g., business, project, and software related).

How to increase and maintain team motivation

The best agile teams are built from people who work together as one unit, where each team member has both the technical and the personal skills to allow the team to become self-organized, cross-functional, and self-motivated. These are all big words that I hear in almost every agile project. Still, the criteria to make a fantastic agile team are practically impossible to achieve without one major factor: motivation towards a common goal.

Nov’22 Updates: Live With Automation Testing On OTT Streaming Devices, Test On Samsung Galaxy Z Fold4, Galaxy Z Flip4, & More

Hola Testers! Hope you all had a great Thanksgiving weekend! To make this time more memorable, we at LambdaTest have something to offer you as a token of appreciation.

What Agile Testing (Actually) Is

So, now that the first installment of this two fold article has been published (hence you might have an idea of what Agile Testing is not in my opinion), I’ve started feeling the pressure to explain what Agile Testing actually means to me.

How To Choose The Right Mobile App Testing Tools

Did you know that according to Statista, the number of smartphone users will reach 18.22 billion by 2025? Let’s face it, digital transformation is skyrocketing and will continue to do so. This swamps the mobile app development market with various options and gives rise to the need for the best mobile app testing tools

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run tox automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful