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