comparison getan/template.py @ 467:59d9c5840273

Porting Python 2 to Python 3.
author Magnus Schieder <mschieder@intevation.de>
date Thu, 03 May 2018 15:38:42 +0200
parents 8922713adbe6
children 31ea48bf8a7c
comparison
equal deleted inserted replaced
466:9dab95965ac6 467:59d9c5840273
71 database = os.path.abspath(DEFAULT_DATABASE) 71 database = os.path.abspath(DEFAULT_DATABASE)
72 else: 72 else:
73 database = os.path.expanduser(os.path.join("~", ".getan", 73 database = os.path.expanduser(os.path.join("~", ".getan",
74 DEFAULT_DATABASE)) 74 DEFAULT_DATABASE))
75 if not os.path.isfile(database): 75 if not os.path.isfile(database):
76 print >> sys.stderr, "'%s' does not exist or is not a file." % database 76 print("'%s' does not exist or is not a file." % database, file=sys.stderr)
77 sys.exit(1) 77 sys.exit(1)
78 78
79 u_week = None 79 u_week = None
80 80
81 c_year = int(date.today().strftime("%Y")) 81 c_year = int(date.today().strftime("%Y"))
83 83
84 if week is not None and year is None: 84 if week is not None and year is None:
85 year = c_year 85 year = c_year
86 86
87 if not os.path.isfile(database): 87 if not os.path.isfile(database):
88 print >> sys.stderr, "'%s' does not exist or is not a file." % database 88 print("'%s' does not exist or is not a file." % database, file=sys.stderr)
89 sys.exit(1) 89 sys.exit(1)
90 90
91 loader = ChoiceLoader([FileSystemLoader(os.path.expanduser(os.path.join( 91 loader = ChoiceLoader([FileSystemLoader(os.path.expanduser(os.path.join(
92 "~", ".getan", "templates"))), 92 "~", ".getan", "templates"))),
93 PackageLoader("getan")]) 93 PackageLoader("getan")])
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)