mirror of
https://github.com/shlomif/PySolFC.git
synced 2025-04-05 00:02:29 -04:00
convert to named sprintf conversions.
They are more robust.
This commit is contained in:
parent
56f90c4fe4
commit
912ec43f91
1 changed files with 5 additions and 4 deletions
|
@ -70,7 +70,7 @@ wikipedia_files = [
|
||||||
main_header = '''<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
|
main_header = '''<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<title>%s</title>
|
<title>%(title)s</title>
|
||||||
<meta name="license" content="GNU General Public License">
|
<meta name="license" content="GNU General Public License">
|
||||||
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
||||||
</head>
|
</head>
|
||||||
|
@ -134,7 +134,7 @@ def getGameRulesFilename(n):
|
||||||
def gen_main_html():
|
def gen_main_html():
|
||||||
for infile, title in files:
|
for infile, title in files:
|
||||||
outfile = open(os.path.join('html', infile), 'w')
|
outfile = open(os.path.join('html', infile), 'w')
|
||||||
print(main_header % title, file=outfile)
|
print(main_header % {'title': title}, file=outfile)
|
||||||
with open(infile, 'r') as file:
|
with open(infile, 'r') as file:
|
||||||
print(file.read(), file=outfile)
|
print(file.read(), file=outfile)
|
||||||
s = '<a href="index.html">Back to the index</a>'
|
s = '<a href="index.html">Back to the index</a>'
|
||||||
|
@ -164,7 +164,8 @@ def gen_rules_html():
|
||||||
|
|
||||||
# open file of list of all rules
|
# open file of list of all rules
|
||||||
out_rules = open(os.path.join('html', 'rules.html'), 'w')
|
out_rules = open(os.path.join('html', 'rules.html'), 'w')
|
||||||
print(main_header % 'PySol - a Solitaire Game Collection', file=out_rules)
|
print(main_header % {'title': 'PySol - a Solitaire Game Collection'},
|
||||||
|
file=out_rules)
|
||||||
with open('rules.html', 'r') as file:
|
with open('rules.html', 'r') as file:
|
||||||
print(file.read(), file=out_rules)
|
print(file.read(), file=out_rules)
|
||||||
|
|
||||||
|
@ -218,7 +219,7 @@ def gen_rules_html():
|
||||||
|
|
||||||
# create file of altnames
|
# create file of altnames
|
||||||
out_rules_alt = open(os.path.join('html', 'rules_alternate.html'), 'w')
|
out_rules_alt = open(os.path.join('html', 'rules_alternate.html'), 'w')
|
||||||
print(main_header % 'PySol - a Solitaire Game Collection',
|
print(main_header % {'title': 'PySol - a Solitaire Game Collection'},
|
||||||
file=out_rules_alt)
|
file=out_rules_alt)
|
||||||
with open('rules_alternate.html', 'r') as file:
|
with open('rules_alternate.html', 'r') as file:
|
||||||
print(file.read(), file=out_rules_alt)
|
print(file.read(), file=out_rules_alt)
|
||||||
|
|
Loading…
Add table
Reference in a new issue