PageRenderTime 48ms CodeModel.GetById 22ms RepoModel.GetById 0ms app.codeStats 0ms

/scripts/setup-path.py

https://bitbucket.org/lindenlab/viewer-beta/
Python | 38 lines | 22 code | 5 blank | 11 comment | 6 complexity | eb25d5663e630474b5c2e53b04c7f62f MD5 | raw file
Possible License(s): LGPL-2.1
  1. #!/usr/bin/env python
  2. """\
  3. @file setup-path.py
  4. @brief Get the python library directory in the path, so we don't have
  5. to screw with PYTHONPATH or symbolic links.
  6. $LicenseInfo:firstyear=2007&license=viewerlgpl$
  7. Second Life Viewer Source Code
  8. Copyright (C) 2010, Linden Research, Inc.
  9. This library is free software; you can redistribute it and/or
  10. modify it under the terms of the GNU Lesser General Public
  11. License as published by the Free Software Foundation;
  12. version 2.1 of the License only.
  13. This library is distributed in the hope that it will be useful,
  14. but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  16. Lesser General Public License for more details.
  17. You should have received a copy of the GNU Lesser General Public
  18. License along with this library; if not, write to the Free Software
  19. Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  20. Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
  21. $/LicenseInfo$
  22. """
  23. import sys
  24. from os.path import realpath, dirname, join
  25. # Walk back to checkout base directory
  26. dir = dirname(dirname(realpath(__file__)))
  27. # Walk in to libraries directory
  28. dir = join(dir, 'indra', 'lib', 'python')
  29. if dir not in sys.path:
  30. sys.path.insert(0, dir)