A Python parser for MediaWiki wikicode https://mwparserfromhell.readthedocs.io/
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.

compat.py 479 B

1234567891011121314151617181920
  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. range = range
  10. from io import StringIO
  11. from urllib.parse import urlencode
  12. from urllib.request import urlopen
  13. else:
  14. range = xrange
  15. from StringIO import StringIO
  16. from urllib import urlencode, urlopen