Guido van Rossum | ea31ea2 | 1997-05-26 05:43:29 +0000 | [diff] [blame] | 1 | """FAQ Wizard customization module. |
Guido van Rossum | 1677e5b | 1997-05-26 00:07:18 +0000 | [diff] [blame] | 2 | |
Guido van Rossum | ea31ea2 | 1997-05-26 05:43:29 +0000 | [diff] [blame] | 3 | Edit this file to customize the FAQ Wizard. For normal purposes, you |
| 4 | should only have to change the FAQ section titles and the small group |
| 5 | of parameters below it. |
Guido van Rossum | 1677e5b | 1997-05-26 00:07:18 +0000 | [diff] [blame] | 6 | |
Guido van Rossum | ea31ea2 | 1997-05-26 05:43:29 +0000 | [diff] [blame] | 7 | """ |
Guido van Rossum | 1677e5b | 1997-05-26 00:07:18 +0000 | [diff] [blame] | 8 | |
| 9 | # Titles of FAQ sections |
Guido van Rossum | ea31ea2 | 1997-05-26 05:43:29 +0000 | [diff] [blame] | 10 | |
Guido van Rossum | 1677e5b | 1997-05-26 00:07:18 +0000 | [diff] [blame] | 11 | SECTION_TITLES = { |
Guido van Rossum | 2305231 | 1997-05-26 06:12:50 +0000 | [diff] [blame] | 12 | # SectionNumber : SectionTitle; need at least one entry |
Guido van Rossum | 1677e5b | 1997-05-26 00:07:18 +0000 | [diff] [blame] | 13 | 1: "General information and availability", |
Guido van Rossum | 1677e5b | 1997-05-26 00:07:18 +0000 | [diff] [blame] | 14 | } |
| 15 | |
Guido van Rossum | ea31ea2 | 1997-05-26 05:43:29 +0000 | [diff] [blame] | 16 | # Parameters you definitely want to change |
| 17 | |
Guido van Rossum | 2305231 | 1997-05-26 06:12:50 +0000 | [diff] [blame] | 18 | SHORTNAME = "Generic" # FAQ name with "FAQ" omitted |
| 19 | PASSWORD = "" # Password for editing |
Guido van Rossum | ea31ea2 | 1997-05-26 05:43:29 +0000 | [diff] [blame] | 20 | OWNERNAME = "GvR" # Name for feedback |
| 21 | OWNEREMAIL = "guido@python.org" # Email for feedback |
| 22 | HOMEURL = "http://www.python.org" # Related home page |
| 23 | HOMENAME = "Python home" # Name of related home page |
Guido van Rossum | 64a1090 | 1998-02-19 21:29:38 +0000 | [diff] [blame] | 24 | RCSBINDIR = "/usr/local/bin/" # Directory containing RCS commands |
Guido van Rossum | ea31ea2 | 1997-05-26 05:43:29 +0000 | [diff] [blame] | 25 | # (must end in a slash) |
| 26 | |
| 27 | # Parameters you can normally leave alone |
| 28 | |
Guido van Rossum | ea31ea2 | 1997-05-26 05:43:29 +0000 | [diff] [blame] | 29 | MAXHITS = 10 # Max #hits to be shown directly |
| 30 | COOKIE_LIFETIME = 28*24*3600 # Cookie expiration in seconds |
| 31 | # (28*24*3600 = 28 days = 4 weeks) |
Guido van Rossum | b1823ad | 1997-12-09 16:04:46 +0000 | [diff] [blame] | 32 | PROCESS_PREFORMAT = 1 # toggle whether preformatted text |
| 33 | # will replace urls and emails with |
| 34 | # HTML links |
Guido van Rossum | ea31ea2 | 1997-05-26 05:43:29 +0000 | [diff] [blame] | 35 | |
Guido van Rossum | fd67f73 | 1997-05-26 19:46:18 +0000 | [diff] [blame] | 36 | # Markers appended to title to indicate recently change |
| 37 | # (may contain HTML, e.g. <IMG>); and corresponding |
| 38 | |
| 39 | MARK_VERY_RECENT = " **" # Changed very recently |
| 40 | MARK_RECENT = " *" # Changed recently |
| 41 | DT_VERY_RECENT = 24*3600 # 24 hours |
| 42 | DT_RECENT = 7*24*3600 # 7 days |
| 43 | |
| 44 | EXPLAIN_MARKS = """ |
Guido van Rossum | d812c07 | 1997-05-26 20:15:44 +0000 | [diff] [blame] | 45 | <P>(Entries marked with ** were changed within the last 24 hours; |
Guido van Rossum | fd67f73 | 1997-05-26 19:46:18 +0000 | [diff] [blame] | 46 | entries marked with * were changed within the last 7 days.) |
| 47 | <P> |
| 48 | """ |
| 49 | |
| 50 | # Version -- don't change unless you edit faqwiz.py |
| 51 | |
Guido van Rossum | 2d3b0d7 | 1998-12-23 21:33:09 +0000 | [diff] [blame] | 52 | WIZVERSION = "1.0.3" # FAQ Wizard version |
Guido van Rossum | fd67f73 | 1997-05-26 19:46:18 +0000 | [diff] [blame] | 53 | |
Guido van Rossum | 2305231 | 1997-05-26 06:12:50 +0000 | [diff] [blame] | 54 | # This parameter is normally overwritten with a dynamic value |
| 55 | |
| 56 | FAQCGI = 'faqw.py' # Relative URL of the FAQ cgi script |
| 57 | import os, sys |
| 58 | FAQCGI = os.path.basename(sys.argv[0]) or FAQCGI |
| 59 | del os, sys |
| 60 | |
Guido van Rossum | 80e57fb | 1997-12-21 07:05:32 +0000 | [diff] [blame] | 61 | # Perl (re module) style regular expression to recognize FAQ entry |
| 62 | # files: group(1) should be the section number, group(2) should be the |
| 63 | # question number. Both should be fixed width so simple-minded |
| 64 | # sorting yields the right order. |
Guido van Rossum | fd67f73 | 1997-05-26 19:46:18 +0000 | [diff] [blame] | 65 | |
Guido van Rossum | 80e57fb | 1997-12-21 07:05:32 +0000 | [diff] [blame] | 66 | OKFILENAME = r"^faq(\d\d)\.(\d\d\d)\.htp$" |
Guido van Rossum | fd67f73 | 1997-05-26 19:46:18 +0000 | [diff] [blame] | 67 | |
| 68 | # Format to construct a FAQ entry file name |
| 69 | |
| 70 | NEWFILENAME = "faq%02d.%03d.htp" |
| 71 | |
Guido van Rossum | 2305231 | 1997-05-26 06:12:50 +0000 | [diff] [blame] | 72 | # Load local customizations on top of the previous parameters |
| 73 | |
| 74 | try: |
| 75 | from faqcust import * |
Guido van Rossum | 178f58a | 1997-06-02 21:39:15 +0000 | [diff] [blame] | 76 | except ImportError: |
Guido van Rossum | 2305231 | 1997-05-26 06:12:50 +0000 | [diff] [blame] | 77 | pass |
| 78 | |
| 79 | # Calculated parameter names |
| 80 | |
| 81 | COOKIE_NAME = SHORTNAME + "-FAQ-Wizard" # Name used for Netscape cookie |
| 82 | FAQNAME = SHORTNAME + " FAQ" # Name of the FAQ |
| 83 | |
Guido van Rossum | ea31ea2 | 1997-05-26 05:43:29 +0000 | [diff] [blame] | 84 | # ---------------------------------------------------------------------- |
| 85 | |
| 86 | # Anything below this point normally needn't be changed; you would |
| 87 | # change this if you were to create e.g. a French translation or if |
| 88 | # you just aren't happy with the text generated by the FAQ Wizard. |
| 89 | |
| 90 | # Most strings here are subject to substitution (string%dictionary) |
| 91 | |
| 92 | # RCS commands |
| 93 | |
| 94 | SH_RLOG = RCSBINDIR + "rlog %(file)s </dev/null 2>&1" |
| 95 | SH_RLOG_H = RCSBINDIR + "rlog -h %(file)s </dev/null 2>&1" |
| 96 | SH_RDIFF = RCSBINDIR + "rcsdiff -r%(prev)s -r%(rev)s %(file)s </dev/null 2>&1" |
Guido van Rossum | 8bc49c8 | 1997-05-26 19:10:37 +0000 | [diff] [blame] | 97 | SH_REVISION = RCSBINDIR + "co -p%(rev)s %(file)s </dev/null 2>&1" |
Guido van Rossum | ea31ea2 | 1997-05-26 05:43:29 +0000 | [diff] [blame] | 98 | SH_LOCK = RCSBINDIR + "rcs -l %(file)s </dev/null 2>&1" |
| 99 | SH_CHECKIN = RCSBINDIR + "ci -u %(file)s <%(tfn)s 2>&1" |
| 100 | |
| 101 | # Titles for various output pages (not subject to substitution) |
| 102 | |
| 103 | T_HOME = FAQNAME + " Wizard " + WIZVERSION |
| 104 | T_ERROR = "Sorry, an error occurred" |
| 105 | T_ROULETTE = FAQNAME + " Roulette" |
| 106 | T_ALL = "The Whole " + FAQNAME |
| 107 | T_INDEX = FAQNAME + " Index" |
| 108 | T_SEARCH = FAQNAME + " Search Results" |
| 109 | T_RECENT = "What's New in the " + FAQNAME |
| 110 | T_SHOW = FAQNAME + " Entry" |
| 111 | T_LOG = "RCS log for %s entry" % FAQNAME |
Guido van Rossum | 8bc49c8 | 1997-05-26 19:10:37 +0000 | [diff] [blame] | 112 | T_REVISION = "RCS revision for %s entry" % FAQNAME |
Guido van Rossum | ea31ea2 | 1997-05-26 05:43:29 +0000 | [diff] [blame] | 113 | T_DIFF = "RCS diff for %s entry" % FAQNAME |
| 114 | T_ADD = "Add an entry to the " + FAQNAME |
| 115 | T_DELETE = "Deleting an entry from the " + FAQNAME |
| 116 | T_EDIT = FAQNAME + " Edit Wizard" |
| 117 | T_REVIEW = T_EDIT + " - Review Changes" |
| 118 | T_COMMITTED = T_EDIT + " - Changes Committed" |
| 119 | T_COMMITFAILED = T_EDIT + " - Commit Failed" |
| 120 | T_CANTCOMMIT = T_EDIT + " - Commit Rejected" |
| 121 | T_HELP = T_EDIT + " - Help" |
| 122 | |
Guido van Rossum | 1677e5b | 1997-05-26 00:07:18 +0000 | [diff] [blame] | 123 | # Generic prologue and epilogue |
| 124 | |
| 125 | PROLOGUE = ''' |
| 126 | <HTML> |
| 127 | <HEAD> |
| 128 | <TITLE>%(title)s</TITLE> |
| 129 | </HEAD> |
| 130 | |
| 131 | <BODY BACKGROUND="http://www.python.org/pics/RedShort.gif" |
| 132 | BGCOLOR="#FFFFFF" |
| 133 | TEXT="#000000" |
| 134 | LINK="#AA0000" |
| 135 | VLINK="#906A6A"> |
| 136 | <H1>%(title)s</H1> |
| 137 | ''' |
| 138 | |
| 139 | EPILOGUE = ''' |
| 140 | <HR> |
| 141 | <A HREF="%(HOMEURL)s">%(HOMENAME)s</A> / |
Guido van Rossum | ea31ea2 | 1997-05-26 05:43:29 +0000 | [diff] [blame] | 142 | <A HREF="%(FAQCGI)s?req=home">%(FAQNAME)s Wizard %(WIZVERSION)s</A> / |
Guido van Rossum | 1677e5b | 1997-05-26 00:07:18 +0000 | [diff] [blame] | 143 | Feedback to <A HREF="mailto:%(OWNEREMAIL)s">%(OWNERNAME)s</A> |
| 144 | |
| 145 | </BODY> |
| 146 | </HTML> |
| 147 | ''' |
| 148 | |
| 149 | # Home page |
| 150 | |
| 151 | HOME = """ |
Guido van Rossum | ea31ea2 | 1997-05-26 05:43:29 +0000 | [diff] [blame] | 152 | <H2>Search the %(FAQNAME)s:</H2> |
| 153 | |
| 154 | <BLOCKQUOTE> |
| 155 | |
Guido van Rossum | 1677e5b | 1997-05-26 00:07:18 +0000 | [diff] [blame] | 156 | <FORM ACTION="%(FAQCGI)s"> |
| 157 | <INPUT TYPE=text NAME=query> |
| 158 | <INPUT TYPE=submit VALUE="Search"><BR> |
Guido van Rossum | ea31ea2 | 1997-05-26 05:43:29 +0000 | [diff] [blame] | 159 | <INPUT TYPE=radio NAME=querytype VALUE=simple CHECKED> |
| 160 | Simple string |
| 161 | / |
| 162 | <INPUT TYPE=radio NAME=querytype VALUE=regex> |
| 163 | Regular expression |
Guido van Rossum | 8bc49c8 | 1997-05-26 19:10:37 +0000 | [diff] [blame] | 164 | /<BR> |
Guido van Rossum | d993695 | 1997-05-26 16:35:27 +0000 | [diff] [blame] | 165 | <INPUT TYPE=radio NAME=querytype VALUE=anykeywords> |
| 166 | Keywords (any) |
| 167 | / |
| 168 | <INPUT TYPE=radio NAME=querytype VALUE=allkeywords> |
| 169 | Keywords (all) |
Guido van Rossum | ea31ea2 | 1997-05-26 05:43:29 +0000 | [diff] [blame] | 170 | <BR> |
| 171 | <INPUT TYPE=radio NAME=casefold VALUE=yes CHECKED> |
| 172 | Fold case |
| 173 | / |
| 174 | <INPUT TYPE=radio NAME=casefold VALUE=no> |
| 175 | Case sensitive |
| 176 | <BR> |
Guido van Rossum | 1677e5b | 1997-05-26 00:07:18 +0000 | [diff] [blame] | 177 | <INPUT TYPE=hidden NAME=req VALUE=search> |
| 178 | </FORM> |
| 179 | |
Guido van Rossum | ea31ea2 | 1997-05-26 05:43:29 +0000 | [diff] [blame] | 180 | </BLOCKQUOTE> |
| 181 | |
| 182 | <HR> |
| 183 | |
| 184 | <H2>Other forms of %(FAQNAME)s access:</H2> |
| 185 | |
Guido van Rossum | 1677e5b | 1997-05-26 00:07:18 +0000 | [diff] [blame] | 186 | <UL> |
| 187 | <LI><A HREF="%(FAQCGI)s?req=index">FAQ index</A> |
| 188 | <LI><A HREF="%(FAQCGI)s?req=all">The whole FAQ</A> |
Guido van Rossum | ea31ea2 | 1997-05-26 05:43:29 +0000 | [diff] [blame] | 189 | <LI><A HREF="%(FAQCGI)s?req=recent">What's new in the FAQ?</A> |
Guido van Rossum | 1677e5b | 1997-05-26 00:07:18 +0000 | [diff] [blame] | 190 | <LI><A HREF="%(FAQCGI)s?req=roulette">FAQ roulette</A> |
Guido van Rossum | ea31ea2 | 1997-05-26 05:43:29 +0000 | [diff] [blame] | 191 | <LI><A HREF="%(FAQCGI)s?req=add">Add a FAQ entry</A> |
| 192 | <LI><A HREF="%(FAQCGI)s?req=delete">Delete a FAQ entry</A> |
Guido van Rossum | 1677e5b | 1997-05-26 00:07:18 +0000 | [diff] [blame] | 193 | </UL> |
| 194 | """ |
| 195 | |
| 196 | # Index formatting |
| 197 | |
| 198 | INDEX_SECTION = """ |
| 199 | <P> |
| 200 | <HR> |
Guido van Rossum | ea31ea2 | 1997-05-26 05:43:29 +0000 | [diff] [blame] | 201 | <H2>%(sec)s. %(title)s</H2> |
Guido van Rossum | 1677e5b | 1997-05-26 00:07:18 +0000 | [diff] [blame] | 202 | <UL> |
| 203 | """ |
| 204 | |
Guido van Rossum | ea31ea2 | 1997-05-26 05:43:29 +0000 | [diff] [blame] | 205 | INDEX_ADDSECTION = """ |
| 206 | <P> |
| 207 | <LI><A HREF="%(FAQCGI)s?req=new&section=%(sec)s">Add new entry</A> |
| 208 | (at this point) |
| 209 | """ |
| 210 | |
Guido van Rossum | 1677e5b | 1997-05-26 00:07:18 +0000 | [diff] [blame] | 211 | INDEX_ENDSECTION = """ |
| 212 | </UL> |
| 213 | """ |
| 214 | |
| 215 | INDEX_ENTRY = """\ |
Guido van Rossum | 030144d | 1997-05-26 16:02:56 +0000 | [diff] [blame] | 216 | <LI><A HREF="%(FAQCGI)s?req=show&file=%(file)s">%(title)s</A> |
Guido van Rossum | 1677e5b | 1997-05-26 00:07:18 +0000 | [diff] [blame] | 217 | """ |
| 218 | |
Guido van Rossum | 8bc49c8 | 1997-05-26 19:10:37 +0000 | [diff] [blame] | 219 | LOCAL_ENTRY = """\ |
| 220 | <LI><A HREF="#%(sec)s.%(num)s">%(title)s</A> |
| 221 | """ |
| 222 | |
Guido van Rossum | 1677e5b | 1997-05-26 00:07:18 +0000 | [diff] [blame] | 223 | # Entry formatting |
| 224 | |
Guido van Rossum | fd67f73 | 1997-05-26 19:46:18 +0000 | [diff] [blame] | 225 | ENTRY_HEADER1 = """ |
Guido van Rossum | ea31ea2 | 1997-05-26 05:43:29 +0000 | [diff] [blame] | 226 | <HR> |
Guido van Rossum | fd67f73 | 1997-05-26 19:46:18 +0000 | [diff] [blame] | 227 | <H2><A NAME="%(sec)s.%(num)s">%(title)s</A>\ |
| 228 | """ |
| 229 | |
| 230 | ENTRY_HEADER2 = """\ |
| 231 | </H2> |
Guido van Rossum | ea31ea2 | 1997-05-26 05:43:29 +0000 | [diff] [blame] | 232 | """ |
| 233 | |
Guido van Rossum | 1677e5b | 1997-05-26 00:07:18 +0000 | [diff] [blame] | 234 | ENTRY_FOOTER = """ |
Guido van Rossum | ea31ea2 | 1997-05-26 05:43:29 +0000 | [diff] [blame] | 235 | <A HREF="%(FAQCGI)s?req=edit&file=%(file)s">Edit this entry</A> / |
| 236 | <A HREF="%(FAQCGI)s?req=log&file=%(file)s">Log info</A> |
Guido van Rossum | 1677e5b | 1997-05-26 00:07:18 +0000 | [diff] [blame] | 237 | """ |
| 238 | |
| 239 | ENTRY_LOGINFO = """ |
| 240 | / Last changed on %(last_changed_date)s by |
| 241 | <A HREF="mailto:%(last_changed_email)s">%(last_changed_author)s</A> |
| 242 | """ |
| 243 | |
| 244 | # Search |
| 245 | |
| 246 | NO_HITS = """ |
| 247 | No hits. |
| 248 | """ |
| 249 | |
| 250 | ONE_HIT = """ |
| 251 | Your search matched the following entry: |
| 252 | """ |
| 253 | |
| 254 | FEW_HITS = """ |
Guido van Rossum | ea31ea2 | 1997-05-26 05:43:29 +0000 | [diff] [blame] | 255 | Your search matched the following %(count)s entries: |
Guido van Rossum | 1677e5b | 1997-05-26 00:07:18 +0000 | [diff] [blame] | 256 | """ |
| 257 | |
| 258 | MANY_HITS = """ |
Guido van Rossum | ea31ea2 | 1997-05-26 05:43:29 +0000 | [diff] [blame] | 259 | Your search matched more than %(MAXHITS)s entries. |
| 260 | The %(count)s matching entries are presented here ordered by section: |
Guido van Rossum | 1677e5b | 1997-05-26 00:07:18 +0000 | [diff] [blame] | 261 | """ |
| 262 | |
| 263 | # RCS log and diff |
| 264 | |
| 265 | LOG = """ |
| 266 | Click on a revision line to see the diff between that revision and the |
| 267 | previous one. |
| 268 | """ |
| 269 | |
Guido van Rossum | 8bc49c8 | 1997-05-26 19:10:37 +0000 | [diff] [blame] | 270 | REVISIONLINK = """\ |
| 271 | <A HREF="%(FAQCGI)s?req=revision&file=%(file)s&rev=%(rev)s" |
| 272 | >%(line)s</A>\ |
| 273 | """ |
Guido van Rossum | 1677e5b | 1997-05-26 00:07:18 +0000 | [diff] [blame] | 274 | DIFFLINK = """\ |
Guido van Rossum | 8bc49c8 | 1997-05-26 19:10:37 +0000 | [diff] [blame] | 275 | (<A HREF="%(FAQCGI)s?req=diff&file=%(file)s&\ |
| 276 | prev=%(prev)s&rev=%(rev)s" |
| 277 | >diff -r%(prev)s -r%(rev)s</A>)\ |
Guido van Rossum | 1677e5b | 1997-05-26 00:07:18 +0000 | [diff] [blame] | 278 | """ |
| 279 | |
| 280 | # Recently changed entries |
| 281 | |
| 282 | NO_RECENT = """ |
| 283 | <HR> |
| 284 | No %(FAQNAME)s entries were changed in the last %(period)s. |
| 285 | """ |
| 286 | |
Guido van Rossum | ea31ea2 | 1997-05-26 05:43:29 +0000 | [diff] [blame] | 287 | VIEW_MENU = """ |
Guido van Rossum | 1677e5b | 1997-05-26 00:07:18 +0000 | [diff] [blame] | 288 | <HR> |
Guido van Rossum | ea31ea2 | 1997-05-26 05:43:29 +0000 | [diff] [blame] | 289 | View entries changed in the last... |
Guido van Rossum | 1677e5b | 1997-05-26 00:07:18 +0000 | [diff] [blame] | 290 | <UL> |
Guido van Rossum | ea31ea2 | 1997-05-26 05:43:29 +0000 | [diff] [blame] | 291 | <LI><A HREF="%(FAQCGI)s?req=recent&days=1">24 hours</A> |
| 292 | <LI><A HREF="%(FAQCGI)s?req=recent&days=2">2 days</A> |
| 293 | <LI><A HREF="%(FAQCGI)s?req=recent&days=3">3 days</A> |
| 294 | <LI><A HREF="%(FAQCGI)s?req=recent&days=7">week</A> |
| 295 | <LI><A HREF="%(FAQCGI)s?req=recent&days=28">4 weeks</A> |
| 296 | <LI><A HREF="%(FAQCGI)s?req=recent&days=365250">millennium</A> |
Guido van Rossum | 1677e5b | 1997-05-26 00:07:18 +0000 | [diff] [blame] | 297 | </UL> |
Guido van Rossum | ea31ea2 | 1997-05-26 05:43:29 +0000 | [diff] [blame] | 298 | """ |
| 299 | |
| 300 | ONE_RECENT = VIEW_MENU + """ |
Guido van Rossum | 1677e5b | 1997-05-26 00:07:18 +0000 | [diff] [blame] | 301 | The following %(FAQNAME)s entry was changed in the last %(period)s: |
| 302 | """ |
| 303 | |
Guido van Rossum | ea31ea2 | 1997-05-26 05:43:29 +0000 | [diff] [blame] | 304 | SOME_RECENT = VIEW_MENU + """ |
| 305 | The following %(count)s %(FAQNAME)s entries were changed |
Guido van Rossum | 1677e5b | 1997-05-26 00:07:18 +0000 | [diff] [blame] | 306 | in the last %(period)s, most recently changed shown first: |
| 307 | """ |
| 308 | |
Guido van Rossum | ea31ea2 | 1997-05-26 05:43:29 +0000 | [diff] [blame] | 309 | TAIL_RECENT = VIEW_MENU |
Guido van Rossum | 1677e5b | 1997-05-26 00:07:18 +0000 | [diff] [blame] | 310 | |
| 311 | # Last changed banner on "all" (strftime format) |
| 312 | LAST_CHANGED = "Last changed on %c %Z" |
| 313 | |
Guido van Rossum | ea31ea2 | 1997-05-26 05:43:29 +0000 | [diff] [blame] | 314 | # "Compat" command prologue (this has no <BODY> tag) |
Guido van Rossum | 1677e5b | 1997-05-26 00:07:18 +0000 | [diff] [blame] | 315 | COMPAT = """ |
| 316 | <H1>The whole %(FAQNAME)s</H1> |
Guido van Rossum | 2aa78ef | 1997-11-21 16:37:54 +0000 | [diff] [blame] | 317 | See also the <A HREF="%(FAQCGI)s?req=home">%(FAQNAME)s Wizard</A>. |
| 318 | <P> |
Guido van Rossum | 1677e5b | 1997-05-26 00:07:18 +0000 | [diff] [blame] | 319 | """ |
| 320 | |
| 321 | # Editing |
| 322 | |
| 323 | EDITHEAD = """ |
| 324 | <A HREF="%(FAQCGI)s?req=help">Click for Help</A> |
| 325 | """ |
| 326 | |
| 327 | REVIEWHEAD = EDITHEAD |
| 328 | |
| 329 | |
| 330 | EDITFORM1 = """ |
| 331 | <FORM ACTION="%(FAQCGI)s" METHOD=POST> |
| 332 | <INPUT TYPE=hidden NAME=req VALUE=review> |
| 333 | <INPUT TYPE=hidden NAME=file VALUE=%(file)s> |
| 334 | <INPUT TYPE=hidden NAME=editversion VALUE=%(editversion)s> |
| 335 | <HR> |
| 336 | """ |
| 337 | |
| 338 | EDITFORM2 = """ |
| 339 | Title: <INPUT TYPE=text SIZE=70 NAME=title VALUE="%(title)s"><BR> |
| 340 | <TEXTAREA COLS=72 ROWS=20 NAME=body>%(body)s |
| 341 | </TEXTAREA><BR> |
| 342 | Log message (reason for the change):<BR> |
| 343 | <TEXTAREA COLS=72 ROWS=5 NAME=log>%(log)s |
| 344 | </TEXTAREA><BR> |
| 345 | Please provide the following information for logging purposes: |
| 346 | <TABLE FRAME=none COLS=2> |
| 347 | <TR> |
| 348 | <TD>Name: |
| 349 | <TD><INPUT TYPE=text SIZE=40 NAME=author VALUE="%(author)s"> |
| 350 | <TR> |
| 351 | <TD>Email: |
| 352 | <TD><INPUT TYPE=text SIZE=40 NAME=email VALUE="%(email)s"> |
| 353 | <TR> |
| 354 | <TD>Password: |
| 355 | <TD><INPUT TYPE=password SIZE=20 NAME=password VALUE="%(password)s"> |
| 356 | </TABLE> |
| 357 | |
| 358 | <INPUT TYPE=submit NAME=review VALUE="Preview Edit"> |
| 359 | Click this button to preview your changes. |
| 360 | """ |
| 361 | |
| 362 | EDITFORM3 = """ |
| 363 | </FORM> |
| 364 | """ |
| 365 | |
| 366 | COMMIT = """ |
| 367 | <INPUT TYPE=submit NAME=commit VALUE="Commit"> |
| 368 | Click this button to commit your changes. |
| 369 | <HR> |
| 370 | """ |
| 371 | |
Guido van Rossum | 2d3b0d7 | 1998-12-23 21:33:09 +0000 | [diff] [blame] | 372 | NOCOMMIT_HEAD = """ |
| 373 | To commit your changes, please correct the following errors in the |
| 374 | form below and click the Preview Edit button. |
| 375 | <UL> |
| 376 | """ |
| 377 | NOCOMMIT_TAIL = """ |
| 378 | </UL> |
Guido van Rossum | 1677e5b | 1997-05-26 00:07:18 +0000 | [diff] [blame] | 379 | <HR> |
| 380 | """ |
| 381 | |
| 382 | CANTCOMMIT_HEAD = """ |
| 383 | Some required information is missing: |
| 384 | <UL> |
| 385 | """ |
Guido van Rossum | 2d3b0d7 | 1998-12-23 21:33:09 +0000 | [diff] [blame] | 386 | NEED_PASSWD = "<LI>You must provide the correct password.\n" |
Guido van Rossum | 1677e5b | 1997-05-26 00:07:18 +0000 | [diff] [blame] | 387 | NEED_AUTHOR = "<LI>You must enter your name.\n" |
| 388 | NEED_EMAIL = "<LI>You must enter your email address.\n" |
| 389 | NEED_LOG = "<LI>You must enter a log message.\n" |
| 390 | CANTCOMMIT_TAIL = """ |
| 391 | </UL> |
| 392 | Please use your browser's Back command to correct the form and commit |
| 393 | again. |
| 394 | """ |
| 395 | |
Guido van Rossum | ea31ea2 | 1997-05-26 05:43:29 +0000 | [diff] [blame] | 396 | NEWCONFLICT = """ |
| 397 | <P> |
| 398 | You are creating a new entry, but the entry number specified is not |
| 399 | correct. |
| 400 | <P> |
| 401 | The two most common causes of this problem are: |
| 402 | <UL> |
| 403 | <LI>After creating the entry yourself, you went back in your browser, |
| 404 | edited the entry some more, and clicked Commit again. |
| 405 | <LI>Someone else started creating a new entry in the same section and |
| 406 | committed before you did. |
| 407 | </UL> |
| 408 | (It is also possible that the last entry in the section was physically |
| 409 | deleted, but this should not happen except through manual intervention |
| 410 | by the FAQ maintainer.) |
| 411 | <P> |
| 412 | <A HREF="%(FAQCGI)s?req=new&section=%(sec)s">Click here to try |
| 413 | again.</A> |
| 414 | <P> |
| 415 | """ |
| 416 | |
Guido van Rossum | 1677e5b | 1997-05-26 00:07:18 +0000 | [diff] [blame] | 417 | VERSIONCONFLICT = """ |
| 418 | <P> |
| 419 | You edited version %(editversion)s but the current version is %(version)s. |
| 420 | <P> |
| 421 | The two most common causes of this problem are: |
| 422 | <UL> |
| 423 | <LI>After committing a change, you went back in your browser, |
| 424 | edited the entry some more, and clicked Commit again. |
| 425 | <LI>Someone else started editing the same entry and committed |
| 426 | before you did. |
| 427 | </UL> |
| 428 | <P> |
Guido van Rossum | ea31ea2 | 1997-05-26 05:43:29 +0000 | [diff] [blame] | 429 | <A HREF="%(FAQCGI)s?req=show&file=%(file)s">Click here to reload |
| 430 | the entry and try again.</A> |
Guido van Rossum | 1677e5b | 1997-05-26 00:07:18 +0000 | [diff] [blame] | 431 | <P> |
| 432 | """ |
| 433 | |
| 434 | CANTWRITE = """ |
| 435 | Can't write file %(file)s (%(why)s). |
| 436 | """ |
| 437 | |
| 438 | FILEHEADER = """\ |
| 439 | Title: %(title)s |
| 440 | Last-Changed-Date: %(date)s |
| 441 | Last-Changed-Author: %(author)s |
| 442 | Last-Changed-Email: %(email)s |
| 443 | Last-Changed-Remote-Host: %(REMOTE_HOST)s |
| 444 | Last-Changed-Remote-Address: %(REMOTE_ADDR)s |
| 445 | """ |
| 446 | |
| 447 | LOGHEADER = """\ |
| 448 | Last-Changed-Date: %(date)s |
| 449 | Last-Changed-Author: %(author)s |
| 450 | Last-Changed-Email: %(email)s |
| 451 | Last-Changed-Remote-Host: %(REMOTE_HOST)s |
| 452 | Last-Changed-Remote-Address: %(REMOTE_ADDR)s |
| 453 | |
| 454 | %(log)s |
| 455 | """ |
| 456 | |
| 457 | COMMITTED = """ |
| 458 | Your changes have been committed. |
| 459 | """ |
| 460 | |
| 461 | COMMITFAILED = """ |
Guido van Rossum | 6592b3c | 1997-11-11 17:18:48 +0000 | [diff] [blame] | 462 | Exit status %(sts)s. |
Guido van Rossum | 1677e5b | 1997-05-26 00:07:18 +0000 | [diff] [blame] | 463 | """ |
| 464 | |
Guido van Rossum | ea31ea2 | 1997-05-26 05:43:29 +0000 | [diff] [blame] | 465 | # Add/Delete |
| 466 | |
| 467 | ADD_HEAD = """ |
| 468 | At the moment, new entries can only be added at the end of a section. |
| 469 | This is because the entry numbers are also their |
| 470 | unique identifiers -- it's a bad idea to renumber entries. |
| 471 | <P> |
| 472 | Click on the section to which you want to add a new entry: |
| 473 | <UL> |
| 474 | """ |
| 475 | |
| 476 | ADD_SECTION = """\ |
| 477 | <LI><A HREF="%(FAQCGI)s?req=new&section=%(section)s">%(section)s. %(title)s</A> |
| 478 | """ |
| 479 | |
| 480 | ADD_TAIL = """ |
| 481 | </UL> |
| 482 | """ |
| 483 | |
Guido van Rossum | f1ead1a | 1997-08-28 02:38:01 +0000 | [diff] [blame] | 484 | ROULETTE = """ |
| 485 | <P>Hit your browser's Reload button to play again.<P> |
| 486 | """ |
| 487 | |
Guido van Rossum | ea31ea2 | 1997-05-26 05:43:29 +0000 | [diff] [blame] | 488 | DELETE = """ |
| 489 | At the moment, there's no direct way to delete entries. |
| 490 | This is because the entry numbers are also their |
| 491 | unique identifiers -- it's a bad idea to renumber entries. |
| 492 | <P> |
| 493 | If you really think an entry needs to be deleted, |
| 494 | change the title to "(deleted)" and make the body |
| 495 | empty (keep the entry number in the title though). |
| 496 | """ |
| 497 | |
| 498 | # Help file for the FAQ Edit Wizard |
| 499 | |
Guido van Rossum | 1677e5b | 1997-05-26 00:07:18 +0000 | [diff] [blame] | 500 | HELP = """ |
| 501 | Using the %(FAQNAME)s Edit Wizard speaks mostly for itself. Here are |
| 502 | some answers to questions you are likely to ask: |
| 503 | |
| 504 | <P><HR> |
| 505 | |
| 506 | <H2>I can review an entry but I can't commit it.</H2> |
| 507 | |
| 508 | The commit button only appears if the following conditions are met: |
| 509 | |
| 510 | <UL> |
| 511 | |
| 512 | <LI>The Name field is not empty. |
| 513 | |
| 514 | <LI>The Email field contains at least an @ character. |
| 515 | |
| 516 | <LI>The Log message box is not empty. |
| 517 | |
| 518 | <LI>The Password field contains the proper password. |
| 519 | |
| 520 | </UL> |
| 521 | |
| 522 | <P><HR> |
| 523 | |
| 524 | <H2>What is the password?</H2> |
| 525 | |
| 526 | At the moment, only PSA members will be told the password. This is a |
| 527 | good time to join the PSA! See <A |
| 528 | HREF="http://www.python.org/psa/">the PSA home page</A>. |
| 529 | |
| 530 | <P><HR> |
| 531 | |
| 532 | <H2>Can I use HTML in the FAQ entry?</H2> |
| 533 | |
| 534 | No, but if you include a URL or an email address in the text it will |
| 535 | automatigally become an anchor of the right type. Also, *word* |
| 536 | is made italic (but only for single alphabetic words). |
| 537 | |
| 538 | <P><HR> |
| 539 | |
| 540 | <H2>How do I delineate paragraphs?</H2> |
| 541 | |
| 542 | Use blank lines to separate paragraphs. |
| 543 | |
| 544 | <P><HR> |
| 545 | |
| 546 | <H2>How do I enter example text?</H2> |
| 547 | |
| 548 | Any line that begins with a space or tab is assumed to be part of |
| 549 | literal text. Blocks of literal text delineated by blank lines are |
| 550 | placed inside <PRE>...</PRE>. |
| 551 | """ |
Guido van Rossum | 5bf4d00 | 1997-06-03 22:03:22 +0000 | [diff] [blame] | 552 | |
| 553 | # Load local customizations again, in case they set some other variables |
| 554 | |
| 555 | try: |
| 556 | from faqcust import * |
| 557 | except ImportError: |
| 558 | pass |