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