viewgit/index.php:465 Only variables should be passed by reference [2048]

viewgit/index.php:466 Non-static method GeSHi::get_language_name_from_extension() should not be called statically [2048]

  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. #
  4. # This is a simple whois daemon intended to
  5. # provide a basic whois for GNet.
  6. #
  7.  
  8. import pywhois
  9. from optparse import OptionParser
  10.  
  11. def SetOption(config, option, field):
  12. if option is not None:
  13. return option
  14. if config.has_key(field):
  15. return config[field]
  16. return None
  17.  
  18. if __name__ == "__main__":
  19.  
  20. parser = OptionParser()
  21. parser.add_option("-v", "--verbose", action="store_true",
  22. default = False, help = "Print syslog to screen")
  23. parser.add_option("-c", "--config", dest="config_file",
  24. default="/etc/pywhoisd.conf",
  25. help = "Set config file", metavar="CONFIG_FILE")
  26. parser.add_option("-p", "--port", dest="port",
  27. help = "The listening port of the daemon", default = "43")
  28. parser.add_option("-l", "--listen", help="The listening address of the daemon",
  29. default = "0.0.0.0", dest="host")
  30. parser.add_option("-t", "--http-port", help="The listening port of the HTTP server",
  31. default = 80, dest = "http_port")
  32.  
  33. (options, args) = parser.parse_args()
  34.  
  35. # Load configuration and create logger
  36. # istance
  37. config = pywhois.Config(options.config_file)
  38. logger = pywhois.Logger(options.verbose)
  39.  
  40. # Prepare the real server, listening to the whole world
  41. host, port = SetOption(config, options.host, "host"), int(SetOption(config, options.port, "port"))
  42. http_port = int(SetOption(config, options.http_port, "http_port"))
  43. server = pywhois.WhoisServer((host, port), logger, config)
  44. http_server = pywhois.BackgroundWhoisHTTPServer((host, port), http_port)
  45. try:
  46. print "Starting http server...",
  47. http_server.start()
  48. print "done"
  49. print "Starting whois server...",
  50. server.serve_forever()
  51. except KeyboardInterrupt:
  52. http_server.shutdown()
  53. http_server.join()
  54. server.shutdown()
  55. logger.Log ("pywhoisd daemon exiting now")
  56.  
  57.  
  58.