A Python robot that edits Wikipedia and interacts with people over IRC https://en.wikipedia.org/wiki/User:EarwigBot
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

12345678910111213141516171819
  1. # -*- coding: utf-8 -*-
  2. class BaseTask(object):
  3. """A base class for bot tasks that edit Wikipedia."""
  4. task_name = None
  5. def __init__(self):
  6. """This is called once immediately after the task class is loaded by
  7. the task manager (in wiki.task_manager.load_class_from_file())."""
  8. pass
  9. def run(self, **kwargs):
  10. """This is called directly by task_manager.start_task() and is the main
  11. way to make a task do stuff. kwargs will be any keyword arguments
  12. passed to start_task(), which are (of course) optional. The same task
  13. instance is preserved between runs, so you can theoretically store data
  14. in self (e.g. start_task('mytask', action='store', data='foo')) and
  15. then use it later (e.g. start_task('mytask', action='save'))."""
  16. pass