mirror of
https://github.com/peeringdb/peeringdb.git
synced 2024-05-11 05:55:09 +00:00
31 lines
632 B
Python
Executable File
31 lines
632 B
Python
Executable File
#!/usr/bin/env python
|
|
|
|
|
|
import logging
|
|
import os
|
|
import sys
|
|
import warnings
|
|
|
|
# supress warnings
|
|
|
|
warnings.filterwarnings("ignore")
|
|
|
|
# print "path", sys.path
|
|
|
|
try:
|
|
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "mainsite.settings")
|
|
|
|
from django.core.management import execute_from_command_line
|
|
|
|
inp = sys.stdin.readline().strip()
|
|
if inp:
|
|
argv = ["in.whoisd", "pdb_whois", inp]
|
|
execute_from_command_line(argv)
|
|
|
|
except BaseException as e:
|
|
# TODO log here - need to inherit
|
|
# log = logging.getLogger('pdb.script.whois')
|
|
# log.exception(e)
|
|
print(f"an error occurred: {e}")
|
|
pass
|