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

26 lines
432 B

  1. # -*- coding: utf-8 -*-
  2. """
  3. Implements support for both Python 2 and Python 3.
  4. """
  5. import sys
  6. py3k = sys.version_info.major == 3
  7. if py3k:
  8. bytes = bytes
  9. str = str
  10. basestring = str
  11. maxsize = sys.maxsize
  12. import html.entities as htmlentities
  13. else:
  14. bytes = str
  15. str = unicode
  16. basestring = basestring
  17. maxsize = sys.maxint
  18. import htmlentitydefs as htmlentities
  19. del sys