1
0
mirror of https://github.com/peeringdb/peeringdb.git synced 2024-05-11 05:55:09 +00:00
Files
peeringdb-peeringdb/in.whoisd
Matt Griswold 5147028bee clean up / format / poetry (#1000)
* stub in poetry for pipenv

* re-add tester image

* add pre-commit / formatting

* fix ghactions

* revert test data whitespace, exclude tests/data

* revert ws

* decruft, rm tox/pipenv

* install dev packages for base image

* add lgtm config to force to py3
2021-07-10 10:12:35 -05:00

26 lines
561 B
Python
Executable File

#!/usr/bin/env python
import logging
import os
import sys
# 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