git.lirion.de

Of git, get, and gud

aboutsummaryrefslogtreecommitdiffstats
path: root/refresh
diff options
context:
space:
mode:
authorH. P. <harald.p.@xmart.de> 2018-09-28 13:26:19 +0200
committerH. P. <harald.p.@xmart.de> 2018-09-28 13:26:19 +0200
commit9848fa8568fd25a6da5b60f56d602274d91de730 (patch)
tree0f15365e65429287eb61016bae2158a08bb3ed4d /refresh
parent18e869b34511fcbf63587f4dfc738448a79f527e (diff)
downloadtimewarrior-holidays-9848fa8568fd25a6da5b60f56d602274d91de730.tar.bz2
fixed wrong type for locode
Diffstat (limited to 'refresh')
-rwxr-xr-xrefresh11
1 files changed, 6 insertions, 5 deletions
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)