A copyright violation detector running on Wikimedia Cloud Services https://tools.wmflabs.org/copyvios/
25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

preconfig.py.ts 1.0 KiB

1234567891011121314151617181920212223242526272829303132
  1. # -*- coding: utf-8 -*-
  2. """
  3. This module contains installation-specific import configuration for the
  4. Toolserver. To add your own, create and put code in the file 'preconfig.py' in
  5. this directory, or rename this file to 'preconfig.py' if you want to use this
  6. specific configuration.
  7. """
  8. import os
  9. import site
  10. import sys
  11. # Add a local platform-specific site package directory:
  12. plat = sys.platform
  13. if plat.startswith("sunos"):
  14. plat = "solaris"
  15. elif plat.startswith("linux"):
  16. plat = "linux"
  17. site.addsitedir(os.path.expanduser("~/.local/" + plat + "/lib/python2.7/site-packages"))
  18. sys.path.insert(0, os.path.expanduser("~/.local/" + plat + "/lib/python2.7/site-packages"))
  19. # EarwigBot, in-between releases, tries to import the 'git' module and add the
  20. # current git commit ID to its __version__ string. This behavior is useful, but
  21. # the Toolserver can be slow at importing things. Insert a fake 'git' module
  22. # into sys.modules so it skips the __version__ addition:
  23. from types import ModuleType
  24. git = ModuleType("git")
  25. sys.modules["git"] = git