Rename to Format.fromargs().
This commit is contained in:
parent
c1c2ab39c2
commit
52bfe6928f
2 changed files with 2 additions and 2 deletions
|
@ -47,7 +47,7 @@ def cli(args=None, output_file=sys.stdout):
|
||||||
start=args.start or source.start(),
|
start=args.start or source.start(),
|
||||||
end=args.end,
|
end=args.end,
|
||||||
)
|
)
|
||||||
fmt = Format.generate(args)
|
fmt = Format.fromargs(args)
|
||||||
result = fetch(series, source, output, args.invert, args.quantize, fmt)
|
result = fetch(series, source, output, args.invert, args.quantize, fmt)
|
||||||
print(result, end="", file=output_file)
|
print(result, end="", file=output_file)
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -12,7 +12,7 @@ class Format:
|
||||||
datesep: str = "-"
|
datesep: str = "-"
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def generate(cls, args):
|
def fromargs(cls, args):
|
||||||
def if_not_none(value, default):
|
def if_not_none(value, default):
|
||||||
return default if value is None else value
|
return default if value is None else value
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue