diff options
author | H. P. <harald.p.@xmart.de> | 2018-09-28 13:26:19 +0200 |
---|---|---|
committer | H. P. <harald.p.@xmart.de> | 2018-09-28 13:26:19 +0200 |
commit | 9848fa8568fd25a6da5b60f56d602274d91de730 (patch) | |
tree | 0f15365e65429287eb61016bae2158a08bb3ed4d /refresh | |
parent | 18e869b34511fcbf63587f4dfc738448a79f527e (diff) | |
download | timewarrior-holidays-9848fa8568fd25a6da5b60f56d602274d91de730.tar.bz2 |
fixed wrong type for locode
Diffstat (limited to 'refresh')
-rwxr-xr-x | refresh | 11 |
1 files changed, 6 insertions, 5 deletions
@@ -110,14 +110,15 @@ def hparse(lines, locode, year): def main(args): if args.locale != "" and args.locale != None: - locode = args.locale + locode = str(args.locale[0]) else: locode = "de-DE" if args.year != None and args.year != []: - year = args.locale + year = args.year else: now = datetime.now() - year = unicode(datetime.now().year) + year = datetime.now().year + year = unicode(year) sys.stdout.write("Fetching holiday data from holidata.net...") sys.stdout.flush() lines = hfetch(locode, year) @@ -134,8 +135,8 @@ if __name__ == "__main__": usage = """See https://holidata.net for details of supported locales and regions.""" parser = argparse.ArgumentParser(description="Update holiday data files. Run 'refresh' for \ the default of de-DE (this will be changed in the future)") - parser.add_argument('--locale', nargs='+', help='Specific locale to update', type=unicode, default="") - parser.add_argument('--region', nargs='+', help='Specific locale region to update', type=unicode, default="") + parser.add_argument('--locale', nargs='+', help='Specific locale to update', type=unicode, default=[]) + parser.add_argument('--region', nargs='+', help='Specific locale region to update', type=unicode, default=[]) parser.add_argument('--year', nargs='+', help='Specific year to fetch.', type=int, default=[]) args = parser.parse_args() main(args) |