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