A copyright violation detector running on Wikimedia Cloud Services https://tools.wmflabs.org/copyvios/
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.
 
 
 
 
 

33 řádky
1.0 KiB

  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