From a112f8a80d3267afbd5a0db0a69f2cae18d4eb22 Mon Sep 17 00:00:00 2001 From: Disassembler Date: Mon, 11 Sep 2017 10:47:42 +0200 Subject: [PATCH] Fix off-by-one error in sahana-lang-csv.py and make it executable --- sahana/sahana-lang-csv.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) mode change 100644 => 100755 sahana/sahana-lang-csv.py diff --git a/sahana/sahana-lang-csv.py b/sahana/sahana-lang-csv.py old mode 100644 new mode 100755 index 1c46feb..70dd096 --- a/sahana/sahana-lang-csv.py +++ b/sahana/sahana-lang-csv.py @@ -15,12 +15,12 @@ basename, extension = os.path.splitext(sys.argv[1].lower()) translations = {} if extension == '.csv': - with open(sys.argv[0], 'rb') as csvfile: + with open(sys.argv[1], 'rb') as csvfile: reader = csv.reader(csvfile, delimiter=',', quotechar='\'') for line in reader: translations[line[1].encode('utf-8')] = line[2].encode('utf-8') elif extension == '.xls': - sheet = xlrd.open_workbook(sys.argv[0]).sheet_by_index(0) + sheet = xlrd.open_workbook(sys.argv[1]).sheet_by_index(0) for i in range(1, sheet.nrows): row = sheet.row(i) translations[row[1].value.encode('utf-8')] = row[2].value.encode('utf-8')