Skip to content

Commit 8d3a373

Browse files
Update version number.
1 parent 7eab25d commit 8d3a373

2 files changed

Lines changed: 10 additions & 10 deletions

File tree

ip2location_csv_converter/ip2location_csv_converter.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -115,27 +115,27 @@ def number_to_hex(row, write_mode, conversion_mode):
115115
# new_row = '"' + from_ip + '","' + to_ip + '","' + remaining_columns
116116
if sys.version < '3':
117117
if remaining_columns == '':
118-
new_row = '"' + from_hex + '","' + to_hex + '"'
118+
new_row = '"' + from_hex + '","' + to_hex + '"\n'
119119
else:
120-
new_row = '"' + from_hex + '","' + to_hex + '","' + remaining_columns
120+
new_row = '"' + from_hex + '","' + to_hex + '","' + remaining_columns + '\n'
121121
else:
122122
if remaining_columns == '':
123-
new_row = '"' + str(from_hex) + '","' + str(to_hex) + '"'
123+
new_row = '"' + str(from_hex) + '","' + str(to_hex) + '"\n'
124124
else:
125-
new_row = '"' + str(from_hex) + '","' + str(to_hex) + '","' + remaining_columns
125+
new_row = '"' + str(from_hex) + '","' + str(to_hex) + '","' + remaining_columns + '\n'
126126
# print (new_row)
127127
elif (write_mode == 'append'):
128128
# new_row = '"' + row[0] + '","' + row[1] + '","' + from_ip + '","' + to_ip + '","' + remaining_columns
129129
if sys.version < '3':
130130
if remaining_columns == '':
131-
new_row = '"' + row[0] + '","' + row[1] + '","' + from_hex + '","' + to_hex + '"'
131+
new_row = '"' + row[0] + '","' + row[1] + '","' + from_hex + '","' + to_hex + '"\n'
132132
else:
133-
new_row = '"' + row[0] + '","' + row[1] + '","' + from_hex + '","' + to_hex + '","' + remaining_columns
133+
new_row = '"' + row[0] + '","' + row[1] + '","' + from_hex + '","' + to_hex + '","' + remaining_columns + '\n'
134134
else:
135135
if remaining_columns == '':
136-
new_row = '"' + row[0] + '","' + row[1] + '","' + str(from_hex) + '","' + str(to_hex) + '"'
136+
new_row = '"' + row[0] + '","' + row[1] + '","' + str(from_hex) + '","' + str(to_hex) + '"\n'
137137
else:
138-
new_row = '"' + row[0] + '","' + row[1] + '","' + str(from_hex) + '","' + str(to_hex) + '","' + remaining_columns
138+
new_row = '"' + row[0] + '","' + row[1] + '","' + str(from_hex) + '","' + str(to_hex) + '","' + remaining_columns + '\n'
139139
return new_row
140140

141141
def convert_to_csv(input_file, output_file, conversion_mode, write_mode):
@@ -169,7 +169,7 @@ def convert_to_csv(input_file, output_file, conversion_mode, write_mode):
169169

170170
if (len(my_list) > 0):
171171
with open(output_file, 'a') as myWrite:
172-
myWrite.writelines("{}\n".format(x) for x in my_list)
172+
myWrite.write(''.join(my_list))
173173

174174
my_list = []
175175

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
setuptools.setup(
1212
name="ip2location-python-csv-converter",
13-
version="1.2.0",
13+
version="1.2.1",
1414
description="Python script to converts IP2Location CSV database into IP range or CIDR format.",
1515
long_description_content_type="text/markdown",
1616
long_description=long_description,

0 commit comments

Comments
 (0)