add option for short and llong verif
This commit is contained in:
parent
b5ecd14119
commit
09dcccfd92
|
|
@ -505,6 +505,8 @@ def tdcpb_check_files(p_dcp_folder, strict=True):
|
|||
.format(_dcp_folder)
|
||||
raise TdcpbException(_msg)
|
||||
#TODO : why not use normpath ?
|
||||
|
||||
print("Verfication DCP en cours ... : {}".format(os.path.basename(_dcp_folder)))
|
||||
try :
|
||||
DCP = DiParser(_dcp_folder)
|
||||
_nb = DCP.check_files(strict=strict)
|
||||
|
|
@ -516,6 +518,7 @@ def tdcpb_check_files(p_dcp_folder, strict=True):
|
|||
raise TdcpbException(_err)
|
||||
logger.info('File check OK for {}'\
|
||||
.format(os.path.basename(_dcp_folder)))
|
||||
print("Verfication DCP courte OK : {}".format(os.path.basename(_dcp_folder)))
|
||||
|
||||
def tdcpb_check_hash(p_dcp_folder):
|
||||
'''
|
||||
|
|
@ -531,6 +534,8 @@ def tdcpb_check_hash(p_dcp_folder):
|
|||
raise TdcpbException(_msg)
|
||||
|
||||
_dcp_folder = os.path.abspath(p_dcp_folder)
|
||||
|
||||
print("Verfication DCP en cours ... : {}".format(os.path.basename(_dcp_folder)))
|
||||
try :
|
||||
DCP = DiParser(_dcp_folder)
|
||||
_res = DCP.check_hash()
|
||||
|
|
@ -541,7 +546,7 @@ def tdcpb_check_hash(p_dcp_folder):
|
|||
print("Verfication DCP ERREUR : {}". \
|
||||
format(os.path.basename(_dcp_folder)))
|
||||
raise TdcpbException(_err)
|
||||
print("Verfication DCP OK : {}".format(os.path.basename(_dcp_folder)))
|
||||
print("Verfication DCP longue OK : {}".format(os.path.basename(_dcp_folder)))
|
||||
logger.info("Hash OK for {}". \
|
||||
format(os.path.basename(_dcp_folder)))
|
||||
|
||||
|
|
@ -563,9 +568,8 @@ def main(argv):
|
|||
type = str,
|
||||
nargs = "?",
|
||||
help = 'DCP path' )
|
||||
#parser.add_argument('-d', '--debug', dest='debug', action='store_const',
|
||||
# const=logging.DEBUG, default=logging.INFO,
|
||||
# help='debug mode')
|
||||
parser.add_argument('-t', '--type',
|
||||
help='type of DCP check: short or long. Default: short', default='short')
|
||||
|
||||
args = parser.parse_args()
|
||||
|
||||
|
|
@ -573,7 +577,7 @@ def main(argv):
|
|||
logger.error("No DCP source")
|
||||
return 1
|
||||
try:
|
||||
tdcpb_check(args.dcp_path, u'long')
|
||||
tdcpb_check(args.dcp_path, args.type)
|
||||
except TdcpbException as _err:
|
||||
logger.error(_err)
|
||||
return 1
|
||||
Loading…
Reference in New Issue