A Python parser for MediaWiki wikicode https://mwparserfromhell.readthedocs.io/
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 
 

19 行
442 B

  1. # -*- coding: utf-8 -*-
  2. """
  3. Serves the same purpose as mwparserfromhell.compat, but only for objects
  4. required by unit tests. This avoids unnecessary imports (like urllib) within
  5. the main library.
  6. """
  7. from mwparserfromhell.compat import py3k
  8. if py3k:
  9. from io import StringIO
  10. from urllib.parse import urlencode
  11. from urllib.request import urlopen
  12. else:
  13. from StringIO import StringIO
  14. from urllib import urlencode, urlopen