A Python robot that edits Wikipedia and interacts with people over IRC https://en.wikipedia.org/wiki/User:EarwigBot
25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.

36 satır
809 B

  1. # -*- coding: utf-8 -*-
  2. """
  3. EarwigBot's Wiki Toolset: Constants
  4. This module defines some useful constants:
  5. * USER_AGENT - our default User Agent when making API queries
  6. * NS_* - default namespace IDs for easy lookup
  7. Import with `from wiki import constants` or `from wiki.constants import *`.
  8. """
  9. # Default User Agent when making API queries:
  10. import platform
  11. USER_AGENT = "EarwigBot/0.1-dev (Python/{0}; https://github.com/earwig/earwigbot)".format(platform.python_version())
  12. # Default namespace IDs:
  13. NS_MAIN = 0
  14. NS_TALK = 1
  15. NS_USER = 2
  16. NS_USER_TALK = 3
  17. NS_PROJECT = 4
  18. NS_PROJECT_TALK = 5
  19. NS_FILE = 6
  20. NS_FILE_TALK = 7
  21. NS_MEDIAWIKI = 8
  22. NS_MEDIAWIKI_TALK = 9
  23. NS_TEMPLATE = 10
  24. NS_TEMPLATE_TALK = 11
  25. NS_HELP = 12
  26. NS_HELP_TALK = 13
  27. NS_CATEGORY = 14
  28. NS_CATEGORY_TALK = 15
  29. NS_SPECIAL = -1
  30. NS_MEDIA = -2