Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Documentation: Added scripts and Control Panel help as Amethyst sources
- conhelp.py: Generate a conhelp file containing commands and variables - makehelp.sh: Generate cphelp/conhelp for engine and games Todo: Convert the latter to Python for platform independence.
- Loading branch information
Showing
4 changed files
with
407 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
"""Generates a console help file out of Amethyst sources. | ||
1 - output filename | ||
2, ... - subdirs to include""" | ||
|
||
import os | ||
import sys | ||
import string | ||
import subprocess | ||
|
||
def amethyst(input): | ||
"""Runs amethyst with the given input and returns the output.""" | ||
p = subprocess.Popen(['amethyst', '-dHELP'], | ||
stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE) | ||
(output, errs) = p.communicate(input) | ||
return output | ||
|
||
outName = sys.argv[1] | ||
components = sys.argv[2:] | ||
modes = ['command', 'variable'] | ||
|
||
outFile = file(outName, 'w') | ||
print >> outFile, "# Doomsday Help" | ||
print >> outFile, "# Generated by conhelp.py out of", string.join(components, ', ') | ||
|
||
for mode in modes: | ||
for com in components: | ||
print >> outFile, "#\n# CONSOLE", mode.upper() + 'S: %s\n#' % com | ||
path = os.path.join(com, mode) | ||
for fn in os.listdir(path): | ||
if not fn.endswith('.ame'): continue | ||
name = fn[:-4] | ||
print >> outFile, "[%s]" % name | ||
|
||
templ = '@require{amestd} @begin\n' + \ | ||
file(os.path.join(path, fn)).read() | ||
|
||
print >> outFile, amethyst(templ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/bin/sh | ||
|
||
cd ../../doc | ||
CONHELP=../build/scripts/conhelp.py | ||
|
||
echo "Engine help" | ||
python $CONHELP ../client/data/cphelp.txt engine | ||
amethyst -dHELP engine/controlpanel.ame >> ../client/data/cphelp.txt | ||
|
||
echo "libdoom help" | ||
python $CONHELP ../plugins/doom/data/conhelp.txt libcommon libdoom | ||
|
||
echo "libheretic help" | ||
python $CONHELP ../plugins/heretic/data/conhelp.txt libcommon libheretic | ||
|
||
echo "libhexen help" | ||
python $CONHELP ../plugins/hexen/data/conhelp.txt libcommon libhexen |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.