A Python robot that edits Wikipedia and interacts with people over IRC https://en.wikipedia.org/wiki/User:EarwigBot
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

constants.py 717 B

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