--- a/Documentation/Source/eric5.DebugClients.Python.FlexCompleter.html Thu Jan 14 17:27:31 2010 +0000 +++ b/Documentation/Source/eric5.DebugClients.Python.FlexCompleter.html Thu Jan 14 18:35:52 2010 +0000 @@ -22,87 +22,87 @@ <body><a NAME="top" ID="top"></a> <h1>eric5.DebugClients.Python.FlexCompleter</h1> <p> -Word completion for the eric5 shell +Word completion for the eric5 shell </p><p> -<h4>NOTE for eric5 variant</h4> +<h4>NOTE for eric5 variant</h4> </p><p> - This version is a re-implementation of FlexCompleter - as found in the PyQwt package. It is modified to work with the eric5 debug - clients. + This version is a re-implementation of FlexCompleter + as found in the PyQwt package. It is modified to work with the eric5 debug + clients. </p><p> </p><p> -<h4>NOTE for the PyQwt variant</h4> +<h4>NOTE for the PyQwt variant</h4> </p><p> - This version is a re-implementation of FlexCompleter - with readline support for PyQt&sip-3.6 and earlier. + This version is a re-implementation of FlexCompleter + with readline support for PyQt&sip-3.6 and earlier. </p><p> - Full readline support is present in PyQt&sip-snapshot-20030531 and later. + Full readline support is present in PyQt&sip-snapshot-20030531 and later. </p><p> </p><p> -<h4>NOTE for FlexCompleter</h4> +<h4>NOTE for FlexCompleter</h4> </p><p> - This version is a re-implementation of rlcompleter with - selectable namespace. + This version is a re-implementation of rlcompleter with + selectable namespace. </p><p> - The problem with rlcompleter is that it's hardwired to work with - __main__.__dict__, and in some cases one may have 'sandboxed' namespaces. So - this class is a ripoff of rlcompleter, with the namespace to work in as an - optional parameter. + The problem with rlcompleter is that it's hardwired to work with + __main__.__dict__, and in some cases one may have 'sandboxed' namespaces. So + this class is a ripoff of rlcompleter, with the namespace to work in as an + optional parameter. </p><p> - This class can be used just like rlcompleter, but the Completer class now has - a constructor with the optional 'namespace' parameter. + This class can be used just like rlcompleter, but the Completer class now has + a constructor with the optional 'namespace' parameter. </p><p> - A patch has been submitted to Python@sourceforge for these changes to go in - the standard Python distribution. + A patch has been submitted to Python@sourceforge for these changes to go in + the standard Python distribution. </p><p> </p><p> -<h4>Original rlcompleter documentation</h4> +<h4>Original rlcompleter documentation</h4> </p><p> - This requires the latest extension to the readline module (the - completes keywords, built-ins and globals in __main__; when completing - NAME.NAME..., it evaluates (!) the expression up to the last dot and - completes its attributes. + This requires the latest extension to the readline module (the + completes keywords, built-ins and globals in __main__; when completing + NAME.NAME..., it evaluates (!) the expression up to the last dot and + completes its attributes. </p><p> - It's very cool to do "import string" type "string.", hit the - completion key (twice), and see the list of names defined by the - string module! + It's very cool to do "import string" type "string.", hit the + completion key (twice), and see the list of names defined by the + string module! </p><p> - Tip: to use the tab key as the completion key, call + Tip: to use the tab key as the completion key, call </p><p> - 'readline.parse_and_bind("tab: complete")' + 'readline.parse_and_bind("tab: complete")' </p><p> - <b>Notes</b>: - <ul> - <li> - Exceptions raised by the completer function are *ignored* (and - generally cause the completion to fail). This is a feature -- since - readline sets the tty device in raw (or cbreak) mode, printing a - traceback wouldn't work well without some complicated hoopla to save, - reset and restore the tty state. - </li> - <li> - The evaluation of the NAME.NAME... form may cause arbitrary - application defined code to be executed if an object with a - __getattr__ hook is found. Since it is the responsibility of the - application (or the user) to enable this feature, I consider this an - acceptable risk. More complicated expressions (e.g. function calls or - indexing operations) are *not* evaluated. - </li> - <li> - GNU readline is also used by the built-in functions input() and - raw_input(), and thus these also benefit/suffer from the completer - features. Clearly an interactive application can benefit by - specifying its own completer function and using raw_input() for all - its input. - </li> - <li> - When the original stdin is not a tty device, GNU readline is never - used, and this module (and the readline module) are silently inactive. - </li> - </ul> + <b>Notes</b>: + <ul> + <li> + Exceptions raised by the completer function are *ignored* (and + generally cause the completion to fail). This is a feature -- since + readline sets the tty device in raw (or cbreak) mode, printing a + traceback wouldn't work well without some complicated hoopla to save, + reset and restore the tty state. + </li> + <li> + The evaluation of the NAME.NAME... form may cause arbitrary + application defined code to be executed if an object with a + __getattr__ hook is found. Since it is the responsibility of the + application (or the user) to enable this feature, I consider this an + acceptable risk. More complicated expressions (e.g. function calls or + indexing operations) are *not* evaluated. + </li> + <li> + GNU readline is also used by the built-in functions input() and + raw_input(), and thus these also benefit/suffer from the completer + features. Clearly an interactive application can benefit by + specifying its own completer function and using raw_input() for all + its input. + </li> + <li> + When the original stdin is not a tty device, GNU readline is never + used, and this module (and the readline module) are silently inactive. + </li> + </ul> </p> <h3>Global Attributes</h3> <table> @@ -112,21 +112,21 @@ <table> <tr> <td><a href="#Completer">Completer</a></td> -<td>Class implementing the command line completer object.</td> +<td>Class implementing the command line completer object.</td> </tr> </table> <h3>Functions</h3> <table> <tr> <td><a href="#get_class_members">get_class_members</a></td> -<td>Module function to retrieve the class members.</td> +<td>Module function to retrieve the class members.</td> </tr> </table> <hr /><hr /> <a NAME="Completer" ID="Completer"></a> <h2>Completer</h2> <p> - Class implementing the command line completer object. + Class implementing the command line completer object. </p> <h3>Derived from</h3> object @@ -138,98 +138,98 @@ <table> <tr> <td><a href="#Completer.__init__">Completer</a></td> -<td>Create a new completer for the command line.</td> +<td>Create a new completer for the command line.</td> </tr><tr> <td><a href="#Completer.attr_matches">attr_matches</a></td> -<td>Compute matches when text contains a dot.</td> +<td>Compute matches when text contains a dot.</td> </tr><tr> <td><a href="#Completer.complete">complete</a></td> -<td>Return the next possible completion for 'text'.</td> +<td>Return the next possible completion for 'text'.</td> </tr><tr> <td><a href="#Completer.global_matches">global_matches</a></td> -<td>Compute matches when text is a simple name.</td> +<td>Compute matches when text is a simple name.</td> </tr> </table> <a NAME="Completer.__init__" ID="Completer.__init__"></a> <h4>Completer (Constructor)</h4> <b>Completer</b>(<i>namespace = None</i>) <p> - Create a new completer for the command line. + Create a new completer for the command line. </p><p> - Completer([namespace]) -> completer instance. + Completer([namespace]) -> completer instance. </p><p> - If unspecified, the default namespace where completions are performed - is __main__ (technically, __main__.__dict__). Namespaces should be - given as dictionaries. + If unspecified, the default namespace where completions are performed + is __main__ (technically, __main__.__dict__). Namespaces should be + given as dictionaries. </p><p> - Completer instances should be used as the completion mechanism of - readline via the set_completer() call: + Completer instances should be used as the completion mechanism of + readline via the set_completer() call: </p><p> - readline.set_completer(Completer(my_namespace).complete) + readline.set_completer(Completer(my_namespace).complete) </p><dl> <dt><i>namespace</i></dt> <dd> -The namespace for the completer. +The namespace for the completer. </dd> </dl><a NAME="Completer.attr_matches" ID="Completer.attr_matches"></a> <h4>Completer.attr_matches</h4> <b>attr_matches</b>(<i>text</i>) <p> - Compute matches when text contains a dot. + Compute matches when text contains a dot. </p><p> - Assuming the text is of the form NAME.NAME....[NAME], and is - evaluatable in self.namespace, it will be evaluated and its attributes - (as revealed by dir()) are used as possible completions. (For class - instances, class members are are also considered.) + Assuming the text is of the form NAME.NAME....[NAME], and is + evaluatable in self.namespace, it will be evaluated and its attributes + (as revealed by dir()) are used as possible completions. (For class + instances, class members are are also considered.) </p><p> - <b>WARNING</b>: this can still invoke arbitrary C code, if an object - with a __getattr__ hook is evaluated. + <b>WARNING</b>: this can still invoke arbitrary C code, if an object + with a __getattr__ hook is evaluated. </p><dl> <dt><i>text</i></dt> <dd> -The text to be completed. (string) +The text to be completed. (string) </dd> </dl><dl> <dt>Returns:</dt> <dd> -A list of all matches. +A list of all matches. </dd> </dl><a NAME="Completer.complete" ID="Completer.complete"></a> <h4>Completer.complete</h4> <b>complete</b>(<i>text, state</i>) <p> - Return the next possible completion for 'text'. + Return the next possible completion for 'text'. </p><p> - This is called successively with state == 0, 1, 2, ... until it - returns None. The completion should begin with 'text'. + This is called successively with state == 0, 1, 2, ... until it + returns None. The completion should begin with 'text'. </p><dl> <dt><i>text</i></dt> <dd> -The text to be completed. (string) +The text to be completed. (string) </dd><dt><i>state</i></dt> <dd> -The state of the completion. (integer) +The state of the completion. (integer) </dd> </dl><dl> <dt>Returns:</dt> <dd> -The possible completions as a list of strings. +The possible completions as a list of strings. </dd> </dl><a NAME="Completer.global_matches" ID="Completer.global_matches"></a> <h4>Completer.global_matches</h4> <b>global_matches</b>(<i>text</i>) <p> - Compute matches when text is a simple name. + Compute matches when text is a simple name. </p><dl> <dt><i>text</i></dt> <dd> -The text to be completed. (string) +The text to be completed. (string) </dd> </dl><dl> <dt>Returns:</dt> <dd> -A list of all keywords, built-in functions and names currently - defined in self.namespace that match. +A list of all keywords, built-in functions and names currently + defined in self.namespace that match. </dd> </dl> <div align="right"><a href="#top">Up</a></div> @@ -238,16 +238,16 @@ <h2>get_class_members</h2> <b>get_class_members</b>(<i>klass</i>) <p> - Module function to retrieve the class members. + Module function to retrieve the class members. </p><dl> <dt><i>klass</i></dt> <dd> -The class object to be analysed. +The class object to be analysed. </dd> </dl><dl> <dt>Returns:</dt> <dd> -A list of all names defined in the class. +A list of all names defined in the class. </dd> </dl> <div align="right"><a href="#top">Up</a></div>