Merge remote-tracking branch 'origin/master' into sdl2-branch
This commit is contained in:
commit
c5af517b3b
3 changed files with 23 additions and 7 deletions
|
|
@ -3,7 +3,7 @@ AC_INIT(Chocolate Doom, 2.999.0, chocolate-doom-dev-list@chocolate-doom.org,
|
||||||
|
|
||||||
PACKAGE_SHORTNAME=${PACKAGE_NAME% Doom}
|
PACKAGE_SHORTNAME=${PACKAGE_NAME% Doom}
|
||||||
PACKAGE_SHORTDESC="Conservative source port"
|
PACKAGE_SHORTDESC="Conservative source port"
|
||||||
PACKAGE_COPYRIGHT="Copyright (C) 1993-2015"
|
PACKAGE_COPYRIGHT="Copyright (C) 1993-2017"
|
||||||
PACKAGE_LICENSE="GNU General Public License, version 2"
|
PACKAGE_LICENSE="GNU General Public License, version 2"
|
||||||
PACKAGE_MAINTAINER="Simon Howard"
|
PACKAGE_MAINTAINER="Simon Howard"
|
||||||
PACKAGE_URL="https://www.chocolate-doom.org/"
|
PACKAGE_URL="https://www.chocolate-doom.org/"
|
||||||
|
|
|
||||||
25
man/docgen
25
man/docgen
|
|
@ -28,6 +28,7 @@
|
||||||
# CONFIG_VARIABLE_INT(my_variable, c_variable),
|
# CONFIG_VARIABLE_INT(my_variable, c_variable),
|
||||||
#
|
#
|
||||||
|
|
||||||
|
import io
|
||||||
import sys
|
import sys
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
|
|
@ -36,6 +37,14 @@ import getopt
|
||||||
|
|
||||||
INCLUDE_STATEMENT_RE = re.compile("@include\s+(\S+)")
|
INCLUDE_STATEMENT_RE = re.compile("@include\s+(\S+)")
|
||||||
|
|
||||||
|
# Use appropriate stdout function for Python 2 or 3
|
||||||
|
|
||||||
|
def stdout(buf):
|
||||||
|
if sys.version_info.major < 3:
|
||||||
|
sys.stdout.write(buf)
|
||||||
|
else:
|
||||||
|
sys.stdout.buffer.write(buf)
|
||||||
|
|
||||||
# Find the maximum width of a list of parameters (for plain text output)
|
# Find the maximum width of a list of parameters (for plain text output)
|
||||||
|
|
||||||
def parameter_list_width(params):
|
def parameter_list_width(params):
|
||||||
|
|
@ -300,7 +309,9 @@ class Parameter:
|
||||||
# Read list of wiki pages
|
# Read list of wiki pages
|
||||||
|
|
||||||
def read_wikipages():
|
def read_wikipages():
|
||||||
with open("wikipages") as f:
|
f = io.open("wikipages", encoding='UTF-8')
|
||||||
|
|
||||||
|
try:
|
||||||
for line in f:
|
for line in f:
|
||||||
line = line.rstrip()
|
line = line.rstrip()
|
||||||
|
|
||||||
|
|
@ -352,7 +363,9 @@ def process_file(filename):
|
||||||
|
|
||||||
current_config_file = None
|
current_config_file = None
|
||||||
|
|
||||||
with open(filename) as f:
|
f = io.open(file, encoding='UTF-8')
|
||||||
|
|
||||||
|
try:
|
||||||
param = None
|
param = None
|
||||||
waiting_for_checkparm = False
|
waiting_for_checkparm = False
|
||||||
|
|
||||||
|
|
@ -414,7 +427,9 @@ def process_files(path):
|
||||||
process_file(path)
|
process_file(path)
|
||||||
|
|
||||||
def print_template(template_file, content):
|
def print_template(template_file, content):
|
||||||
with open(template_file) as f:
|
f = io.open(template_file, encoding='UTF-8')
|
||||||
|
|
||||||
|
try:
|
||||||
for line in f:
|
for line in f:
|
||||||
match = INCLUDE_STATEMENT_RE.search(line)
|
match = INCLUDE_STATEMENT_RE.search(line)
|
||||||
if match:
|
if match:
|
||||||
|
|
@ -424,7 +439,7 @@ def print_template(template_file, content):
|
||||||
print_template(filename, content)
|
print_template(filename, content)
|
||||||
else:
|
else:
|
||||||
line = line.replace("@content", content)
|
line = line.replace("@content", content)
|
||||||
print(line.rstrip())
|
stdout(line.rstrip().encode('UTF-8') + b'\n')
|
||||||
|
|
||||||
def manpage_output(targets, template_file):
|
def manpage_output(targets, template_file):
|
||||||
|
|
||||||
|
|
@ -441,7 +456,7 @@ def wiki_output(targets, template):
|
||||||
read_wikipages()
|
read_wikipages()
|
||||||
|
|
||||||
for t in targets:
|
for t in targets:
|
||||||
print(t.wiki_output())
|
stdout(t.wiki_output().encode('UTF-8') + b'\n')
|
||||||
|
|
||||||
def plaintext_output(targets, template_file):
|
def plaintext_output(targets, template_file):
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -40,6 +40,7 @@
|
||||||
#
|
#
|
||||||
|
|
||||||
import collections
|
import collections
|
||||||
|
import io
|
||||||
import sys
|
import sys
|
||||||
import re
|
import re
|
||||||
|
|
||||||
|
|
@ -76,7 +77,7 @@ def parse_stream(stream):
|
||||||
raise Exception("Mismatched #if in '%s'" % stream.name)
|
raise Exception("Mismatched #if in '%s'" % stream.name)
|
||||||
|
|
||||||
def parse_file(filename):
|
def parse_file(filename):
|
||||||
f = open(filename)
|
f = io.open(filename, encoding='UTF-8')
|
||||||
|
|
||||||
try:
|
try:
|
||||||
parse_stream(f)
|
parse_stream(f)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue