Skip to content

Commit ac70945

Browse files
committed
Update to python3 support
1 parent 786577a commit ac70945

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

csv-localizer

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env python
1+
#!/usr/bin/env python3
22
import sys, argparse, logging, os, csv
33

44
PLATFORM = None
@@ -18,9 +18,9 @@ def main(args, loglevel):
1818
# check DELIMITER
1919
if args.delimiter == None : DELIMITER = ','
2020

21-
print '\n'
21+
print ('\n')
2222
logging.info("Start Localizing .... ")
23-
print '\n'
23+
print ('\n')
2424
logging.info("------------------------------------")
2525

2626
# check source path
@@ -68,7 +68,7 @@ def main(args, loglevel):
6868

6969
logging.info("Generated output directory: %s" % OUTPUT_DIR)
7070
generate_keys(IN_PATH, OUTPUT_DIR, PLATFORM, DELIMITER)
71-
print '\n'
71+
print ('\n')
7272
logging.info("DONE LOCALIZING.\n")
7373

7474
def generate_keys(source_path, output, platform, delimiter):
@@ -84,7 +84,7 @@ def generate_keys(source_path, output, platform, delimiter):
8484

8585
fullpath = os.path.join(dirname, f)
8686

87-
with open(fullpath, 'rb') as csvfile:
87+
with open(fullpath, 'r') as csvfile:
8888
reader = csv.reader(csvfile, delimiter=delimiter)
8989
# create language key
9090
for i, line in enumerate(reader):
@@ -140,7 +140,7 @@ def start_localize_ios(source_path, all_writes, lang_keys, delimiter):
140140
fullpath = os.path.join(dirname, f)
141141
logging.info("Localizing: %s to iOS", filename)
142142

143-
with open(fullpath, 'rb') as csvfile:
143+
with open(fullpath, 'r') as csvfile:
144144
[fwrite.write('\n/* {0} */\n'.format(filename)) for fwrite in allwrites]
145145

146146
reader = csv.reader(csvfile, delimiter=delimiter)
@@ -181,7 +181,7 @@ def start_localize_android(source_path, all_writes, lang_keys, delimiter):
181181
fullpath = os.path.join(dirname, f)
182182
logging.info("Localizing: %s to Android", filename)
183183

184-
with open(fullpath, 'rb') as csvfile:
184+
with open(fullpath, 'r') as csvfile:
185185
[fwrite.write('\n<!-- {0} -->\n'.format(filename)) for fwrite in allwrites]
186186

187187
reader = csv.reader(csvfile, delimiter=delimiter)
@@ -223,7 +223,7 @@ def start_localize_json(source_path, all_writes, lang_keys, delimiter):
223223

224224
current_row = 0
225225

226-
with open(fullpath, 'rb') as csvfile:
226+
with open(fullpath, 'r') as csvfile:
227227
[fwrite.write('\n') for fwrite in allwrites]
228228

229229
reader = csv.reader(csvfile, delimiter=delimiter)

0 commit comments

Comments
 (0)