Compare commits

...

2 Commits

Author SHA1 Message Date
Lionel Dricot 28d22c4d11 do not try to open files if they dont exist 2023-08-31 20:45:52 +02:00
Lionel Dricot 446c940820 error proofing fetch-later 2023-08-31 20:39:13 +02:00
2 changed files with 11 additions and 3 deletions

View File

@ -1836,10 +1836,13 @@ def main():
if args.url:
gc.sync_only = True
for u in args.url:
if netcache.is_cache_valid(u):
gc.list_add_line("tour",u)
if looks_like_url(u):
if netcache.is_cache_valid(u):
gc.list_add_line("tour",u)
else:
gc.list_add_line("to_fetch",u)
else:
gc.list_add_line("to_fetch",u)
print("%s is not a valid URL to fetch"%u)
else:
print("--fetch-later requires an URL (or a list of URLS) as argument")
elif args.sync:

View File

@ -189,6 +189,11 @@ class opencache():
cachepath = netcache.fetch(inpath,**kwargs)
if not cachepath:
return False
elif os.path.exists(inpath):
cachepath = inpath
else:
print("%s does not exist"%inpath)
return
renderer = self.get_renderer(inpath,mode=mode)
if renderer and mode:
renderer.set_mode(mode)