Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions log2s3/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -956,14 +956,14 @@ def arg2arg(fn: click.Command, args: dict, baseparam: dict) -> dict:
break
elif isinstance(opt.envvar, str) and opt.envvar and os.getenv(opt.envvar):
params[opt.name] = os.getenv(opt.envvar)
elif opt.default or not opt.required:
elif (opt.default or not opt.required) and opt.default != UNSET:
params[opt.name] = opt.default
pnames = [x.name for x in fn.params]
for name in pnames:
if name in args:
if args[name] != UNSET:
params[name] = args[name]
elif name in baseparam:
elif name in baseparam and baseparam[name] != UNSET:
params[name] = baseparam[name]
_log.debug("arg=%s, base=%s, result=%s", args, baseparam, params)
return params
Expand Down
3 changes: 2 additions & 1 deletion log2s3/processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import pathlib
import time
import shutil
from click.core import UNSET
from logging import getLogger
from typing import Optional, Sequence
from abc import ABC, abstractmethod
Expand Down Expand Up @@ -34,7 +35,7 @@ def check_date_range(self, mtime: float) -> bool:
newer = pytimeparse.parse(self.config["newer"])
if newer is not None and mtime < time.time() - newer:
return False
if "date" in self.config:
if "date" in self.config and self.config["date"] != UNSET:
mtime_datetime = datetime.datetime.fromtimestamp(mtime)
if ".." in self.config["date"]:
fromdate, todate = [
Expand Down
Loading