diff options
-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) |