A Python parser for MediaWiki wikicode https://mwparserfromhell.readthedocs.io/
Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.
 
 
 
 

19 righe
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