mirror of
https://github.com/GothenburgBitFactory/timewarrior.git
synced 2025-07-07 20:06:39 +02:00
Simplify region filtering by setting a default value
Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
This commit is contained in:
parent
bb905fd0b9
commit
ff562b8a9e
1 changed files with 2 additions and 2 deletions
|
@ -70,7 +70,7 @@ def update_locales(locales, regions, years):
|
|||
for line in lines.split('\n'):
|
||||
if line:
|
||||
j = json.loads(line)
|
||||
if j['region'] == '' or regions is None or len(regions) == 0 or j['region'] in regions:
|
||||
if not j['region'] or not regions or j['region'] in regions:
|
||||
day = j['date'].replace("-", "_")
|
||||
desc = j['description']
|
||||
fh.write(" {} = {}\n".format(day, desc))
|
||||
|
@ -104,7 +104,7 @@ if __name__ == "__main__":
|
|||
parser = argparse.ArgumentParser(
|
||||
description="Update holiday data files. Simply run 'refresh' to update all of them.")
|
||||
parser.add_argument('--locale', nargs='+', help='Specific locale to update.')
|
||||
parser.add_argument('--region', nargs='+', help='Specific locale region to update.')
|
||||
parser.add_argument('--region', nargs='+', help='Specific locale region to update.', default=[])
|
||||
parser.add_argument('--year', nargs='+', help='Specific year to fetch.', type=int, default=[])
|
||||
args = parser.parse_args()
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue