Skip to content

Commit 9d98495

Browse files
committed
Missing parameter in guess_country()
1 parent d4c2fd6 commit 9d98495

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

archinstall.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -752,7 +752,7 @@ def get_external_ip(*positionals, **kwargs):
752752
result = urllib.request.urlopen("https://hvornum.se/ip/?f=json").read().decode('UTF-8')
753753
return json.loads(result)['ip']
754754

755-
def guess_country(*positionals, **kwargs):
755+
def guess_country(ip, *positionals, **kwargs):
756756
# python-pygeoip
757757
# geoip-database
758758
result = None
@@ -761,6 +761,7 @@ def guess_country(*positionals, **kwargs):
761761
try:
762762
import pygeoip
763763
except:
764+
## TODO: Do a best-effort-guess based off the hostname given off the IP instead, if GoeIP doesn't exist.
764765
return result
765766

766767
gi = pygeoip.GeoIP(GEOIP_DB)
@@ -818,9 +819,7 @@ def setup_args_defaults(args, interactive=True):
818819
country = None
819820
if get_default_gateway_linux():
820821
ip = get_external_ip()
821-
print('IP:', ip)
822822
country = guess_country(ip)
823-
print('Country:', country)
824823
args['country'] = 'all' if not country else country
825824
if not 'localtime' in args: args['localtime'] = 'Europe/Stockholm' if args['country'] == 'SE' else 'GMT+0' # TODO: Arbitrary for now
826825

0 commit comments

Comments
 (0)