From 9848fa8568fd25a6da5b60f56d602274d91de730 Mon Sep 17 00:00:00 2001 From: Harald Pfeiffer Date: Fri, 28 Sep 2018 13:26:19 +0200 Subject: fixed wrong type for locode --- refresh | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'refresh') diff --git a/refresh b/refresh index dd94f80..d568df1 100755 --- a/refresh +++ b/refresh @@ -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) -- cgit v1.2.3