mirror of
				https://github.com/peeringdb/peeringdb.git
				synced 2024-05-11 05:55:09 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			26 lines
		
	
	
		
			569 B
		
	
	
	
		
			Python
		
	
	
		
			Executable File
		
	
	
	
	
			
		
		
	
	
			26 lines
		
	
	
		
			569 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("an error occurred: {}".format(e))
 | 
						|
    pass
 |