add few arg cmds

This commit is contained in:
nelzomal
2024-06-12 10:17:37 +08:00
parent 645ec729f6
commit 985ea93caf
3 changed files with 28 additions and 3 deletions

View File

@@ -1,3 +1,4 @@
import argparse
import logging
from .crawler_util import *
@@ -18,3 +19,13 @@ def init_loging_config():
logger = init_loging_config()
def str2bool(v):
if isinstance(v, bool):
return v
if v.lower() in ('yes', 'true', 't', 'y', '1'):
return True
elif v.lower() in ('no', 'false', 'f', 'n', '0'):
return False
else:
raise argparse.ArgumentTypeError('Boolean value expected.')