Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2305231

Browse files
committed
Added a local customization feature: load some parameters from faqcust.
1 parent 46a160f commit 2305231

1 file changed

Lines changed: 22 additions & 10 deletions

File tree

Tools/faqwiz/faqconf.py

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,34 +9,46 @@
99
# Titles of FAQ sections
1010

1111
SECTION_TITLES = {
12+
# SectionNumber : SectionTitle; need at least one entry
1213
1: "General information and availability",
13-
2: "Python in the real world",
14-
3: "Building Python and Other Known Bugs",
15-
4: "Programming in Python",
16-
5: "Extending Python",
17-
6: "Python's design",
18-
7: "Using Python on non-UNIX platforms",
1914
}
2015

2116
# Parameters you definitely want to change
2217

23-
PASSWORD = "Spam" # Editing password
24-
FAQNAME = "Python FAQ" # Name of the FAQ
18+
SHORTNAME = "Generic" # FAQ name with "FAQ" omitted
19+
PASSWORD = "" # Password for editing
2520
OWNERNAME = "GvR" # Name for feedback
2621
OWNEREMAIL = "[email protected]" # Email for feedback
2722
HOMEURL = "http://www.python.org" # Related home page
2823
HOMENAME = "Python home" # Name of related home page
29-
COOKIE_NAME = "Python-FAQ-Wizard" # Name used for Netscape cookie
3024
RCSBINDIR = "/depot/gnu/plat/bin/" # Directory containing RCS commands
3125
# (must end in a slash)
3226

3327
# Parameters you can normally leave alone
3428

35-
FAQCGI = 'faqw.py' # Relative URL of the FAQ cgi script
3629
MAXHITS = 10 # Max #hits to be shown directly
3730
COOKIE_LIFETIME = 28*24*3600 # Cookie expiration in seconds
3831
# (28*24*3600 = 28 days = 4 weeks)
3932

33+
# This parameter is normally overwritten with a dynamic value
34+
35+
FAQCGI = 'faqw.py' # Relative URL of the FAQ cgi script
36+
import os, sys
37+
FAQCGI = os.path.basename(sys.argv[0]) or FAQCGI
38+
del os, sys
39+
40+
# Load local customizations on top of the previous parameters
41+
42+
try:
43+
from faqcust import *
44+
except ImporError:
45+
pass
46+
47+
# Calculated parameter names
48+
49+
COOKIE_NAME = SHORTNAME + "-FAQ-Wizard" # Name used for Netscape cookie
50+
FAQNAME = SHORTNAME + " FAQ" # Name of the FAQ
51+
4052
# Regular expression to recognize FAQ entry files: group(1) should be
4153
# the section number, group(2) should be the question number. Both
4254
# should be fixed width so simple-minded sorting yields the right

0 commit comments

Comments
 (0)