checkout:
@if [ ! -d tools/sphinx ]; then \
echo "Checking out Sphinx..."; \
- svn checkout $(SVNROOT)/doctools/trunk/sphinx tools/sphinx; \
+ svn checkout $(SVNROOT)/external/Sphinx-0.6.1/sphinx tools/sphinx; \
fi
@if [ ! -d tools/docutils ]; then \
echo "Checking out Docutils..."; \
.. toctree::
:maxdepth: 2
+ :numbered:
introduction.rst
setupscript.rst
are more than welcome as well.
.. toctree::
+ :numbered:
intro.rst
style.rst
.. toctree::
:maxdepth: 2
+ :numbered:
extending.rst
newtypes.rst
.. toctree::
:maxdepth: 2
+ :numbered:
intro.rst
functions.rst
function will not follow symbolic links. Availability: Unix.
-.. function:: link(src, dst)
+.. function:: link(source, link_name)
- Create a hard link pointing to *src* named *dst*. Availability: Unix.
+ Create a hard link pointing to *source* named *link_name*. Availability:
+ Unix.
.. function:: listdir(path)
:attr:`f_flag`, :attr:`f_namemax`. Availability: Unix.
-.. function:: symlink(src, dst)
+.. function:: symlink(source, link_name)
- Create a symbolic link pointing to *src* named *dst*. Availability: Unix.
+ Create a symbolic link pointing to *source* named *link_name*. Availability:
+ Unix.
.. function:: unlink(path)
Some simple format string examples::
"First, thou shalt count to {0}" # References first positional argument
+ "Bring me a {}" # Implicitly references the first positional argument
"My quest is {name}" # References keyword argument 'name'
"Weight in tons {0.weight}" # 'weight' attribute of first positional arg
"Units destroyed: {players[0]}" # First element of keyword argument 'players'.
Browser Controller Objects
--------------------------
-Browser controllers provide these methods which parallel two of the module-level
-convenience functions:
+Browser controllers provide these methods which parallel three of the
+module-level convenience functions:
.. method:: controller.open(url[, new[, autoraise=1]])
.. toctree::
:maxdepth: 2
+ :numbered:
introduction.rst
lexical_analysis.rst
def write(self, *ignored):
writer = TextWriter(self)
- for label in self.status_iterator(pydoc_topic_labels, 'building topics... '):
+ for label in self.status_iterator(pydoc_topic_labels,
+ 'building topics... ',
+ length=len(pydoc_topic_labels)):
if label not in self.env.labels:
self.warn('label %r not in documentation' % label)
continue
The :ref:`glossary` is also worth going through.
.. toctree::
+ :numbered:
appetite.rst
interpreter.rst
.. toctree::
+ :numbered:
cmdline.rst
unix.rst
# The rules according to Greg Stein:
-# 1) a version number has 1 or more numbers separate by a period or by
+# 1) a version number has 1 or more numbers separated by a period or by
# sequences of letters. If only periods, then these are compared
# left-to-right to determine an ordering.
# 2) sequences of letters are part of the tuple for comparison and are
else: #returning default, print warning
if warn_on_default:
warning = ('\n Warning: configHandler.py - IdleConf.GetOption -\n'
- ' problem retrieving configration option %r\n'
+ ' problem retrieving configuration option %r\n'
' from section %r.\n'
' returning default value: %r\n' %
(option, section, default))
+++ /dev/null
-"""
-The regular expression engine in '_sre' can segfault when interpreting
-bogus bytecode.
-
-It is unclear whether this is a real bug or a "won't fix" case like
-bogus_code_obj.py, because it requires bytecode that is built by hand,
-as opposed to compiled by 're' from a string-source regexp. The
-difference with bogus_code_obj, though, is that the only existing regexp
-compiler is written in Python, so that the C code has no choice but
-accept arbitrary bytecode from Python-level.
-
-The test below builds and runs random bytecodes until 'match' crashes
-Python. I have not investigated why exactly segfaults occur nor how
-hard they would be to fix. Here are a few examples of 'code' that
-segfault for me:
-
- [21, 50814, 8, 29, 16]
- [21, 3967, 26, 10, 23, 54113]
- [29, 23, 0, 2, 5]
- [31, 64351, 0, 28, 3, 22281, 20, 4463, 9, 25, 59154, 15245, 2,
- 16343, 3, 11600, 24380, 10, 37556, 10, 31, 15, 31]
-
-Here is also a 'code' that triggers an infinite uninterruptible loop:
-
- [29, 1, 8, 21, 1, 43083, 6]
-
-"""
-
-import _sre, random
-
-def pick():
- n = random.randrange(-65536, 65536)
- if n < 0:
- n &= 31
- return n
-
-ss = ["", "world", "x" * 500]
-
-while 1:
- code = [pick() for i in range(random.randrange(5, 25))]
- print(code)
- pat = _sre.compile(None, 0, code)
- for s in ss:
- try:
- pat.match(s)
- except RuntimeError:
- pass
+++ /dev/null
-# f.close() is not thread-safe: calling it at the same time as another
-# operation (or another close) on the same file, but done from another
-# thread, causes crashes. The issue is more complicated than it seems,
-# witness the discussions in:
-#
-# http://bugs.python.org/issue595601
-# http://bugs.python.org/issue815646
-
-import _thread
-
-while 1:
- f = open("multithreaded_close.tmp", "w")
- _thread.start_new_thread(f.close, ())
- f.close()
}
+#ifdef WITH_THREAD
static void
Tkapp_ThreadSend(TkappObject *self, Tcl_Event *ev,
Tcl_Condition *cond, Tcl_Mutex *mutex)
Tcl_MutexUnlock(mutex);
Py_END_ALLOW_THREADS
}
+#endif
\f
/** Tcl Eval **/
return newPyTclObject(value);
}
+#ifdef WITH_THREAD
/* This mutex synchronizes inter-thread command calls. */
-
TCL_DECLARE_MUTEX(call_mutex)
typedef struct Tkapp_CallEvent {
PyObject **exc_type, **exc_value, **exc_tb;
Tcl_Condition *done;
} Tkapp_CallEvent;
+#endif
void
Tkapp_CallDeallocArgs(Tcl_Obj** objv, Tcl_Obj** objStore, int objc)
return res;
}
+#ifdef WITH_THREAD
+
/* Tkapp_CallProc is the event procedure that is executed in the context of
the Tcl interpreter thread. Initially, it holds the Tcl lock, and doesn't
hold the Python lock. */
return 1;
}
+#endif
+
/* This is the main entry point for calling a Tcl command.
It supports three cases, with regard to threading:
1. Tcl is not threaded: Must have the Tcl lock, then can invoke command in
\f
/** Tcl Variable **/
+typedef PyObject* (*EventFunc)(PyObject*, PyObject *args, int flags);
+
+#ifdef WITH_THREAD
TCL_DECLARE_MUTEX(var_mutex)
-typedef PyObject* (*EventFunc)(PyObject*, PyObject *args, int flags);
typedef struct VarEvent {
Tcl_Event ev; /* must be first */
PyObject *self;
PyObject **exc_val;
Tcl_Condition *cond;
} VarEvent;
+#endif
static int
varname_converter(PyObject *in, void *_out)
return 0;
}
+#ifdef WITH_THREAD
+
static void
var_perform(VarEvent *ev)
{
return 1;
}
+#endif
+
static PyObject*
var_invoke(EventFunc func, PyObject *selfptr, PyObject *args, int flags)
{
- TkappObject *self = (TkappObject*)selfptr;
#ifdef WITH_THREAD
+ TkappObject *self = (TkappObject*)selfptr;
if (self->threaded && self->thread_id != Tcl_GetCurrentThread()) {
TkappObject *self = (TkappObject*)selfptr;
VarEvent *ev;
\f
+#ifdef WITH_THREAD
TCL_DECLARE_MUTEX(command_mutex)
typedef struct CommandEvent{
Tcl_MutexUnlock(&command_mutex);
return 1;
}
+#endif
static PyObject *
Tkapp_CreateCommand(PyObject *selfptr, PyObject *args)
Py_INCREF(func);
data->self = selfptr;
data->func = func;
-
+#ifdef WITH_THREAD
if (self->threaded && self->thread_id != Tcl_GetCurrentThread()) {
Tcl_Condition cond = NULL;
CommandEvent *ev = (CommandEvent*)ckalloc(sizeof(CommandEvent));
Tkapp_ThreadSend(self, (Tcl_Event*)ev, &cond, &command_mutex);
Tcl_ConditionFinalize(&cond);
}
- else {
+ else
+#endif
+ {
ENTER_TCL
err = Tcl_CreateCommand(
Tkapp_Interp(self), cmdName, PythonCmd,
if (!PyArg_ParseTuple(args, "s:deletecommand", &cmdName))
return NULL;
+
+#ifdef WITH_THREAD
if (self->threaded && self->thread_id != Tcl_GetCurrentThread()) {
Tcl_Condition cond = NULL;
CommandEvent *ev;
&command_mutex);
Tcl_ConditionFinalize(&cond);
}
- else {
+ else
+#endif
+ {
ENTER_TCL
err = Tcl_DeleteCommand(self->interp, cmdName);
LEAVE_TCL