__init__.py 1.5 KB

123456789101112131415161718192021222324252627282930313233
  1. # Copyright (C) 2011 Internet Systems Consortium.
  2. #
  3. # Permission to use, copy, modify, and distribute this software for any
  4. # purpose with or without fee is hereby granted, provided that the above
  5. # copyright notice and this permission notice appear in all copies.
  6. #
  7. # THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SYSTEMS CONSORTIUM
  8. # DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
  9. # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
  10. # INTERNET SYSTEMS CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
  11. # INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
  12. # FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
  13. # NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
  14. # WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  15. # This file is not installed. The log.so is installed into the right place.
  16. # It is only to find it in the .libs directory when we run as a test or
  17. # from the build directory.
  18. # But as nobody gives us the builddir explicitly (and we can't use generation
  19. # from .in file, as it would put us into the builddir and we wouldn't be found)
  20. # we guess from current directory. Any idea for something better? This should
  21. # be enough for the tests, but would it work for B10_FROM_SOURCE as well?
  22. # Should we look there? Or define something in bind10_config?
  23. import os
  24. import sys
  25. for base in sys.path[:]:
  26. loglibdir = os.path.join(base, 'isc/log/.libs')
  27. if os.path.exists(loglibdir):
  28. sys.path.insert(0, loglibdir)
  29. from log import *