wesnoth/data/tools
2020-02-04 18:05:59 -06:00
..
addon_manager website: New Year copyright update 2020-01-10 00:03:52 -03:00
emacs_mode Migrate links to https if available - Fwd c18537edc0 2018-10-07 03:23:36 +00:00
pywmlx wmlxgettext: support double quotes in raw strings (fixes #4484) 2019-10-19 20:37:39 +02:00
rmtrans Made README files Markdown 2017-04-28 15:07:06 +11:00
unit_tree website: New Year copyright update 2020-01-10 00:03:52 -03:00
vim wesml.vim: Missing tags and typos. 2019-12-21 23:03:47 -04:00
wesnoth wesnoth_addon_manager: do not generate packet.dump files any more 2020-01-13 17:29:12 +01:00
about_cfg_to_wiki Make Credits page on wiki.w.o use the new TOC markup for mobile support 2018-10-07 03:22:25 +00:00
campaign2wiki.py Migrate links to https if available 2019-09-08 07:53:28 +02:00
expand-terrain-macros.py Ported expand-terrain-macros to Python 3 2019-09-16 21:59:07 +02:00
extractbindings Converted extractbindings script to Python 3 2016-06-22 17:15:18 +02:00
GUI.pyw GUI.pyw: allow terminating the running script 2018-10-25 23:08:59 +02:00
helpheader.html wesmere: Don't use explicit tabindex (see wesnoth/wesmere#8) 2017-08-29 21:55:41 -03:00
helptrailer.html website: New Year copyright update 2020-01-10 00:03:52 -03:00
hexometer.py Addressed more whitespace issues from #2613 2018-03-12 03:48:59 +11:00
imgcheck Converted imgcheck to Python 3 2015-12-20 21:46:25 +01:00
Makefile Addressed more whitespace issues from #2613 2018-03-12 03:48:59 +11:00
README.md Update changelog and readme for trackplacer python3 port 2019-11-18 18:24:28 +01:00
steam-changelog tools: Add steam-changelog 2018-10-07 03:22:33 +00:00
terrain2wiki.py terrain2wiki uses the image of the stable github branch instead of master 2016-11-25 09:58:54 +01:00
tmx_trackplacer trackplacer3 a utility to export and import tmx files (#4365) 2019-11-14 13:43:25 +01:00
trackviewer.pyw Add trackviewer, remove trackplacer 2019-11-18 16:57:26 +01:00
wesnoth_addon_manager wesnoth_addon_manager: use tabs instead of spaces as field separators in --list output 2019-12-20 11:53:20 +01:00
wmlflip Ported wmlflip to Python 3 2019-09-20 22:01:31 +02:00
wmlindent wmlindent: fixed crash on non-existent paths 2018-10-07 03:23:39 +00:00
wmllint Remove WoV from wmlling and schema_validation 2020-02-04 18:05:59 -06:00
wmllint-1.4 Migrate links to https if available - Fwd c18537edc0 2018-10-07 03:23:36 +00:00
wmlscope wmlscope: detect and analyze optional macro arguments 2019-12-02 21:23:58 +01:00
wmlunits wmlunits: Allow detecting wmlunits with the __WMLUNITS__ preprocessor symbol 2017-08-15 16:20:46 -03:00
wmlxgettext wmlxgettext: fix #4275: not handle objectives.lua's turn counter 2019-09-11 14:32:16 +02:00

Tools for hacking or generating WML, maps, images, and sounds belong here. Tools for sanity-checking the mainline campaigns and associated data also belong here. Other utils are in utils/.

== Scripts ==

=== rmtrans ===

Remove nearly transparent pixels from images using GIMP. It currently affects only one image at a time. Batch processing is available within GIMP, but it would be useful to expand this to skip files where the pixels did not change.

=== tmx_trackplacer ===

Converter for journey track files, the .cfg files which control the icon sequences that appear on Wesnoth story screens. This can convert them to or from the format needed for editing in Tiled.

=== trackviewer.pyw ===

Previews the animation of journey tracks.

=== wesnoth_addon_manager ===

Command-line client for uploading WML content to and downloading from the add-on server.

=== wmlflip ===

Experimental tool that can hack a .cfg referring to a mapfile so that all macros with X,Y coordinate pair arguments get their calls transformed in a specified way. Now supports only flipping the map around the Y axis, but provides a framework that should make other transformations easy.

=== wmllint ===

This tool lifts WML from older dialects to current and performs sanity checks. See the header comment of wmllint for a description and invocation options.

=== GUI.pyw ===

A Tkinter based GUI interface for wmllint, wmlscope and wmllint, to aid WML developers frightened of the command line.

=== wmlscope ===

A WML cross-reference checker. Normally you'll use this to list unresolved symbols, if any. See the header comment of wmlscope for a description and invocation options.

=== wmlunits ===

List names of all units in mainline, either as a mediawiki table or as HTML.

=== TeamColorizer ===

Map the magenta team-color patches in the input image to red in the output image, copy the result to output. (This script lives under unit_tree).

=== extractbindings ===

Extract and format a list of keystroke bindings from a theme file. Presently this generates a table suitable for wiki inclusion.

=== terrain2wiki.py ===

A script to create the "Terrain Table" on the TerrainCodeTableWML wiki page. Run this and splice the output into the wiki whenever you add a new terrain type to mainline.

=== campaign2wiki.py ===

A script that generates general information about mainline campaigns and outputs wiki-ready output

== Python API ==

=== wmltools.py ===

The main facility in this module is a cross-referencer class. It also contains utility methods for working with the data tree. See the header comment of wmltools.py for details

=== wmliterator.py ===

A WML codewalker class. Not a full parser, but that's useful because it doesn't get confused by unbalanced macros; instead it lets you walk through lines in a text file parsing out tags and elements

=== wmlparser.py ===

This python module contains code originally developed for CampGen - it contains a general WML Parser written in Python, just like the Perl one. So if you want to develop tools in Python instead of Perl and need a WML parser, it may save some time.

The API currently is very sparsely documented, but I plan to extend this. In general, wmlparser.py contains the WML Parser, which is used like:

parser = wmlparser.Parser(datapath)

Then:

parser.parse_file(filename) or parser.parse_stream(file) or parser.parse_text(string)

to set what to parse, and finally:

wmldata = parser.parse()

to read everything into a Python representation of the parsed data.

=== wmldata.py ===

This file has several utility methods defined to access and manipulate WML data. Most of them will not be generally useful. An example:

for unit in wmldata.get_all("unit"): print unit.get_text_val("id")

== Standalone use ==

=== wmlparser ===

If called standalone, wmlparser.py will parse whatever you give it and dump back to stdout. For example:

python wmlparser.py -e {game.cfg} > game.dump

Should produce a nice several 100000 lines file of the complete configuration with all included files and macros expanded to a single file.