Skip to content

Commit cbb3e14

Browse files
committed
Minor fix
1 parent fa5c09d commit cbb3e14

File tree

3 files changed

+10
-8
lines changed

3 files changed

+10
-8
lines changed

ip2trace.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -132,13 +132,14 @@ def print_usage():
132132
"\n"
133133
" -d, --database\n"
134134
" Specify the path of IP2Location BIN database file. You can download the latest free IP2Location BIN database from https://lite.ip2location.com.\n"
135+
" If the database filename is specified but without the path, ip2tracepy will search the database file in /usr/share/ip2location/ for Linux or C:\Users\(your_Windows_username)\Documents\ for Windows.\n"
135136
"\n"
136137
" -t, --ttl\n"
137138
" Set the max number of hops. (Default: 30)\n"
138139
"\n"
139140
" -o, --output\n"
140141
" Set the desired IP2Location BIN database columns to output with.\n"
141-
" Available columns are: country_code, country_name, region_name, city_name, isp, latitude, longitude, domain, zip_code, time_zone, net_speed, idd_code, area_code, weather_station_code, weather_station_name, mcc, mnc, mobile_brand, elevation, usage_type.\n"
142+
" Available columns are: country_code, country_name, region_name, city_name, isp, latitude, longitude, domain, zip_code, time_zone, net_speed, idd_code, area_code, weather_station_code, weather_station_name, mcc, mnc, mobile_brand, elevation, usage_type, address_type, category.\n"
142143
"\n"
143144
" -a, --all\n"
144145
"Print all the column(s) available based on the BIN file used.\n"
@@ -151,7 +152,7 @@ def print_usage():
151152

152153
def print_version():
153154
print(
154-
"IP2Location Geolocation Traceroute (ip2trace) Version 3.0.0\n"
155+
"IP2Location Geolocation Traceroute (ip2trace) Version 3.1.0\n"
155156
"Copyright (c) 2021 IP2Location.com [MIT License]\n"
156157
"https://www.ip2location.com/free/traceroute-application\n")
157158

@@ -226,7 +227,7 @@ def __init__(self, destination_server, database, max_hops, output, all):
226227
sys.exit()
227228

228229
def print_start(self):
229-
print("IP2Location Geolocation Traceroute (ip2trace) Version 3.0.0\n"
230+
print("IP2Location Geolocation Traceroute (ip2trace) Version 3.1.0\n"
230231
"Copyright (c) 2021 IP2Location.com [MIT License]\n"
231232
"https://www.ip2location.com/free/traceroute-application\n\n")
232233
# print("Traceroute to", self.destination_domain_name[0], "(", self.destination_ip, ")\n\n", end="")
@@ -294,7 +295,7 @@ def print_trace(self, delays, ip_header):
294295
for attr, value in record.__dict__.items():
295296
record_dict[attr] = value
296297
# print(record_dict["region"])
297-
if (self.output is True):
298+
if (self.output is not None):
298299
for i in self.output:
299300
if (i in ip2location_outputs_reference) and (ip2location_result_fields[ip2location_outputs_reference.index(i)] in record_dict) and (record_dict[ip2location_result_fields[ip2location_outputs_reference.index(i)]] is not None):
300301
display_result = display_result + '"' + str(record_dict[ip2location_result_fields[ip2location_outputs_reference.index(i)]]) + '",'

readme.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,14 @@ Usage: ip2tracepy -p [IP ADDRESS/HOSTNAME] -d [IP2LOCATION BIN DATA PATH] [OPTIO
2222
2323
-d, --database
2424
Specify the path of IP2Location BIN database file. You can download the latest free IP2Location BIN database from https://lite.ip2location.com.
25+
If the database filename is specified but without the path, ip2tracepy will search the database file in /usr/share/ip2location/ for Linux or C:\Users\(your_Windows_username)\Documents\ for Windows.
2526
2627
-t, --ttl
2728
Set the max number of hops. (Default: 30)
2829
2930
-o, --output
3031
Set the desired IP2Location BIN database columns to output with.
31-
Available columns are: country_code, country_name, region_name, city_name, isp, latitude, longitude, domain, zip_code, time_zone, net_speed, idd_code, area_code, weather_station_code, weather_station_name, mcc, mnc, mobile_brand, elevation, usage_type.
32+
Available columns are: country_code, country_name, region_name, city_name, isp, latitude, longitude, domain, zip_code, time_zone, net_speed, idd_code, area_code, weather_station_code, weather_station_name, mcc, mnc, mobile_brand, elevation, usage_type, address_type, category.
3233
3334
-a, --all
3435
Print all the column(s) available based on the BIN file used.
@@ -51,7 +52,7 @@ ip2tracepy 8.8.8.8 -d /usr/share/ip2location/DB3.BIN -a
5152
Example output:
5253

5354
```bash
54-
IP2Location Geolocation Traceroute (ip2trace) Version 2.1.6
55+
IP2Location Geolocation Traceroute (ip2trace) Version 3.1.0
5556
Copyright (c) 2021 IP2Location.com [MIT License]
5657
https://www.ip2location.com/free/traceroute-application
5758

@@ -77,7 +78,7 @@ ip2tracepy google.com -d /usr/share/ip2location/DB3.BIN -a
7778
Example output:
7879

7980
```bash
80-
IP2Location Geolocation Traceroute (ip2trace) Version 2.1.6
81+
IP2Location Geolocation Traceroute (ip2trace) Version 3.1.0
8182
Copyright (c) 2021 IP2Location.com [MIT License]
8283
https://www.ip2location.com/free/traceroute-application
8384

setup.py

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

77
setuptools.setup(
88
name="IP2Trace",
9-
version="3.0.0",
9+
version="3.1.0",
1010
description="A Python tool to display geolocation information in the traceroute.",
1111
long_description_content_type="text/markdown",
1212
long_description=long_description,

0 commit comments

Comments
 (0)