Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
5c7f55db
Commit
5c7f55db
authored
Aug 02, 2010
by
Georg Brandl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove faqwiz tool.
parent
04d259f0
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
0 additions
and
1620 deletions
+0
-1620
Tools/faqwiz/README
Tools/faqwiz/README
+0
-114
Tools/faqwiz/faqconf.py
Tools/faqwiz/faqconf.py
+0
-577
Tools/faqwiz/faqcust.py
Tools/faqwiz/faqcust.py
+0
-1
Tools/faqwiz/faqw.py
Tools/faqwiz/faqw.py
+0
-33
Tools/faqwiz/faqwiz.py
Tools/faqwiz/faqwiz.py
+0
-840
Tools/faqwiz/move-faqwiz.sh
Tools/faqwiz/move-faqwiz.sh
+0
-55
No files found.
Tools/faqwiz/README
deleted
100644 → 0
View file @
04d259f0
FAQ Wizard
----------
Author: Guido van Rossum <guido@python.org>
Version: 1.0
Date: 6 April 1998
This is a CGI program that maintains a user-editable FAQ. It uses RCS
to keep track of changes to individual FAQ entries. It is fully
configurable; everything you might want to change when using this
program to maintain some other FAQ than the Python FAQ is contained in
the configuration module, faqconf.py.
Note that the bulk of the code is not an executable script; it's an
importable module. The actual script in cgi-bin is minimal.
Files:
faqw.py executable script to be edited and installed in cgi-bin
faqwiz.py main module, lives in same directory as FAQ entry files
faqconf.py main configuration module
faqcust.py additional local customization module (optional)
move-faqwiz.sh Script to move faqwiz entries.
What's New?
-----------
Version 1.0 corrects some minor bugs and uses tab-agnostic
indentation; it is otherwise unchanged from version 0.9.0.
Version 0.9.0 uses the re module (Perl style regular expressions) for
all its regular expression needs, instead of the regex and regsub
modules (Emacs style). This affects the syntax for regular
expressions entered by the user as search strings (with "regular
expression" checked), hence the version number jump.
Setup Information
-----------------
This assumes you are familiar with Python, with your http server, and
with running CGI scripts under your http server. You need Python 1.5
or better.
Select a place where the Python modules that constitute the FAQ wizard
will live (the directory where you unpacked it is an obvious choice).
This will be called the SRCDIR. This directory should not be writable
by other users of your system (since they would be able to execute
arbitrary code by invoking the FAQ wizard's CGI script).
Create a dedicated working directory, preferably one that's not
directly reachable from your http server. This will be called the
FAQDIR. Create a subdirectory named RCS. Make both the working
directory and the RCS subdirectory wrld-writable. (This is essential,
since the FAQ wizard runs as use nobody, and needs to create
additional files here!)
Edit faqconf.py to reflect your setup. You only need to edit the top
part, up till the line of all dashes. The comments should guide you
in your edits. (Actually, you can also choose to add your changes to
faqcust.py and leave faqconf.py alone. This is essential if you are
maintaining multiple FAQs; see below.)
Don't forget to edit the SECTION_TITLES variables to reflect the set
of section titles for your FAQ!
Next, edit faqw.py to reflect the pathname of your Python interpreter
and the values for SRCDIR and FAQDIR that you just chose. Then
install faqw.py in your cgi-bin directory. Make sure that it is
world-executable. You should now be able to connect to the FAQ wizard
by entering the following URL in your web client (subsituting the
appropriate host and port for "your.web.server", and perhaps
specifying a different directory for "cgi-bin" if local conventions so
dictate):
http://your.web.server/cgi-bin/faqw.py
If you are unable to get this working, check your server's error_log
file. The documentation for Python's cgi module in the Python Library
Reference Manual gives plentyu additional information about installing
and debugging CGI scripts, including setup debugging. This
documentation is repeated in the doc string in the cgi module; try
``import cgi; print cgi.__doc__''.
Assuming this works, you should now be able to add the first entry to
your FAQ using the FAQ wizard interface. This creates a file
faq01.001.htp in your working directory and an RCS revision history
file faq01.001.htp,v in the RCS subdirectory. You can now exercise
the other FAQ wizard features (search, index, whole FAQ, what's new,
roulette, and so on).
Maintaining Multiple FAQs
-------------------------
If you have multiple FAQs, you need a separate FAQDIR per FAQ, and a
different customization file per FAQ. The easiest thing to do would
be to have the faqcust.py for each FAQ live in the FAQDIR for that
FAQ, but that creates some security concerns, since the FAQDIR must be
world writable: *if* someone who breaks into your system (or a
legitimate user) manages to edit the faqcust.py file they can get
arbitrary code to execute through the FAQ wizard. Therefore, you will
need a more complex setup.
The best way is probably to have a directory that is only writable by
you for each FAQ, where you place the copy of faqcust.py for that FAQ,
and have a world-writable subdirectory DATA for the data. You then
set FAQDIR to point to the DATA directory and change the faqw.py
bootstrap script to add FAQDIR/.. to sys.path (in front of SRCDIR, so
the dummy faqcust.py from SRCDIR is ignored).
--Guido van Rossum (home page: http://www.python.org/~guido/)
Tools/faqwiz/faqconf.py
deleted
100644 → 0
View file @
04d259f0
This diff is collapsed.
Click to expand it.
Tools/faqwiz/faqcust.py
deleted
100644 → 0
View file @
04d259f0
# Add your customizations here -- modified copies of what's in faqconf.py.
Tools/faqwiz/faqw.py
deleted
100755 → 0
View file @
04d259f0
#!/usr/bin/env python3
"""FAQ wizard bootstrap."""
# This is a longer version of the bootstrap script given at the end of
# faqwin.py; it prints timing statistics at the end of the regular CGI
# script's output (so you can monitor how it is doing).
# This script should be placed in your cgi-bin directory and made
# executable.
# You need to edit the first line and the lines that define FAQDIR and
# SRCDIR, below: change /usr/local/bin/python to where your Python
# interpreter lives, change the value for FAQDIR to where your FAQ
# lives, and change the value for SRCDIR to where your faqwiz.py
# module lives. The faqconf.py and faqcust.py files live there, too.
import
os
t1
=
os
.
times
()
# If this doesn't work, just get rid of the timing code!
try
:
FAQDIR
=
"/usr/people/guido/python/FAQ"
SRCDIR
=
"/usr/people/guido/python/src/Tools/faqwiz"
import
os
,
sys
os
.
chdir
(
FAQDIR
)
sys
.
path
.
insert
(
0
,
SRCDIR
)
import
faqwiz
except
SystemExit
as
n
:
sys
.
exit
(
n
)
except
:
t
,
v
,
tb
=
sys
.
exc_info
()
print
()
import
cgi
cgi
.
print_exception
(
t
,
v
,
tb
)
Tools/faqwiz/faqwiz.py
deleted
100644 → 0
View file @
04d259f0
This diff is collapsed.
Click to expand it.
Tools/faqwiz/move-faqwiz.sh
deleted
100755 → 0
View file @
04d259f0
#!/bin/sh
#
# Christian Reis <kiko@async.com.br>
#
# Moves
#
# Example:
#
# blackjesus:~> ./move-faqwiz.sh 2\.1 3\.2
# Moving FAQ question 02.001 to 03.002
if
[
x
$2
=
x
]
;
then
echo
"Need 2 args: original_version final_version."
exit
2
fi
if
[
!
-d
data
-o
!
-d
data/RCS
]
;
then
echo
"Run this inside the faqwiz data/ directory's parent dir."
exit
2
fi
cut_n_pad
()
{
t
=
`
echo
$1
|
cut
-d
.
-f
$2
`
export
$3
=
`
echo
$t
|
awk
"{ tmp =
\\
$0
; l = length(tmp); for (i = 0; i <
$2
-l+1; i++) { tmp = "
0
".tmp } print tmp }"
`
}
cut_n_pad
$1
1 prefix1
cut_n_pad
$1
2 suffix1
cut_n_pad
$2
1 prefix2
cut_n_pad
$2
2 suffix2
if
which tempfile
>
/dev/null
;
then
tmpfile
=
$(
tempfile
-d
.
)
elif
[
-n
"
$RANDOM
"
]
;
then
tmpfile
=
tmp
$RANDOM
.tmp
else
tmpfile
=
tmp
$$
.tmp
fi
file1
=
faq
$prefix1
.
$suffix1
.htp
file2
=
faq
$prefix2
.
$suffix2
.htp
echo
"Moving FAQ question
$prefix1
.
$suffix1
to
$prefix2
.
$suffix2
"
sed
-e
"s/
$1
\.
/
$2
\.
/g"
data/
$file1
>
${
tmpfile
}
1
sed
-e
"s/
$1
\.
/
$2
\.
/g"
data/RCS/
$file1
,v
>
${
tmpfile
}
2
if
[
-f
data/
$file2
]
;
then
echo
"Target FAQ exists. Won't clobber."
exit
2
fi
mv
${
tmpfile
}
1 data/
$file2
mv
${
tmpfile
}
2 data/RCS/
$file2
,v
mv
data/
$file1
data/
$file1
.orig
mv
data/RCS/
$file1
,v data/RCS/
$file1
,v.orig
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment