A Python parser for MediaWiki wikicode https://mwparserfromhell.readthedocs.io/
No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.
 
 
 
 

43 líneas
930 B

  1. from __future__ import print_function
  2. import subprocess
  3. import sys
  4. import os
  5. path = os.path.split(__file__)[0]
  6. if path:
  7. os.chdir(path)
  8. environments = ['26', '27', '32', '33', '34']
  9. target = "pypi" if "--push" in sys.argv else "test"
  10. returnvalues = {}
  11. def run(pyver, cmds, target=None):
  12. cmd = [r"C:\Python%s\Python.exe" % pyver, "setup.py"] + cmds
  13. if target:
  14. cmd += ["-r", target]
  15. print(" ".join(cmd), end=" ")
  16. retval = subprocess.call(cmd, stdout=open("%s%s.log" % (cmds[0], pyver), 'w'), stderr=subprocess.STDOUT, cwd="..")
  17. if not retval:
  18. print("[OK]")
  19. else:
  20. print("[FAILED (%i)]" % retval)
  21. return retval
  22. run("27", ["register"], target)
  23. if 'failed' in open('register27.log').read():
  24. raise Exception
  25. for pyver in environments:
  26. print()
  27. try:
  28. os.unlink('mwparserfromhell/parser/_tokenizer.pyd')
  29. except WindowsError:
  30. pass
  31. if run(pyver, ["test"]) == 0:
  32. run(pyver, ["bdist_wheel", "upload"], target)