Exemplo n.º 1
0
	def GET(self, callsign):
		
		call = license(callsign)
		
		if call.status is not "OK" or not call.valid:
			return template.error(call.callsign, call.reason)
		else:
			return template.code(call.callsign, call.code)
Exemplo n.º 2
0
	def GET(self, callsign):
		callpass = license(callsign)
		return callpass.json()
Exemplo n.º 3
0
	def GET(self, callsign):
		web.header("Content-Type", "application/json")
		call = license(callsign)
		return call.json
Exemplo n.º 4
0
	
	parser.add_option("-i", "--host",
	                  action="store",
	                  dest="host",
	                  default=False,
	                  help="This flag will start the http server at the specified address.")
	
	parser.add_option("-p", "--port",
	                  action="store", # optional because action defaults to "store"
	                  dest="port",
	                  default="8000",
	                  help="Specify the port to run on (default 8000)",)
	
	(options, args) = parser.parse_args()
	
	if options.run_server is not False or options.host is not False:
		import server
		server.start(options.host, options.port)
	
	else:
		if len(args) != 1:
			parser.error("wrong number of arguments")
	
		import tools
		call = tools.license( args[0] )
		
		if not call.status == 'OK':
			print 'The database is currently in state:', call.status
		elif not call.valid: print call.reason
		else: print 'Your APRS-IS passcode is', call.hash