From 882bb3106c04a5d98b227a235886171dff125d5f Mon Sep 17 00:00:00 2001 From: Mirochill Date: Mon, 25 May 2026 20:26:00 +0200 Subject: [PATCH] Detect missing required WACZ files --- wacz/validate.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/wacz/validate.py b/wacz/validate.py index ca01a55..a480803 100644 --- a/wacz/validate.py +++ b/wacz/validate.py @@ -30,23 +30,23 @@ def check_required_contents(self): print("Datapackage is missing from your wacz file") return 1 if ( - glob.glob(os.path.join(self.dir.name, "archive/*.warc")) == False - and glob.glob(os.path.join(self.dir.name, "archive/*.warc.gz")) == False + not glob.glob(os.path.join(self.dir.name, "archive/*.warc")) + and not glob.glob(os.path.join(self.dir.name, "archive/*.warc.gz")) ): print( "A warc file is missing from your archive folder you must have a .warc or .warc.gz file in your archive folder" ) return 1 if ( - glob.glob(os.path.join(self.dir.name, "indexes/index.cdx.gz")) == False - and glob.glob(os.path.join(self.dir.name, "indexes/index.cdx.gz")) == False - and glob.glob(os.path.join(self.dir.name, "indexes/index.idx")) == False + not glob.glob(os.path.join(self.dir.name, "indexes/index.cdx.gz")) + and not glob.glob(os.path.join(self.dir.name, "indexes/index.cdx")) + and not glob.glob(os.path.join(self.dir.name, "indexes/index.idx")) ): print( "An index file is missing from your indexes folder you must have an index.cdx.gz, index,cdx or index.idx in your index folder" ) return 1 - if glob.glob(os.path.join(self.dir.name, "pages/pages.jsonl")) == False: + if not glob.glob(os.path.join(self.dir.name, "pages/pages.jsonl")): print( "An index file is missing from your indexes folder you must have an index.cdx.gz, index,cdx or index.idx in your index folder" )