3 #ifndef PYCONSOLE_ENHINTERP_H_
4 #define PYCONSOLE_ENHINTERP_H_
9 #include "PyConsole_Interp.h"
15 * Enhanced Python interpreter used for auto-completion.
16 * This extends PyConsole_Interp with an API wrapping the Python dir() command nicely.
19 class PyConsole_EnhInterp: public PyConsole_Interp
23 : PyConsole_Interp(), _last_matches(0), _doc_str("")
26 virtual ~PyConsole_EnhInterp() {}
28 const std::vector<QString>& getLastMatches() const { return _last_matches; }
29 const QString & getDocStr() const { return _doc_str; }
31 virtual int runDirCommand(const QString& dirArgument, const QString& startMatch);
32 virtual void clearCompletion();
35 /** Hard coded list of Python keywords */
36 static const std::vector<QString> PYTHON_KEYWORDS;
38 /** Last computed matches */
39 std::vector<QString> _last_matches;
40 /** Doc string of the first match - when only one match it will be displayed by the Editor*/
43 virtual int runDirAndExtract(const QString& dirArgument, const QString & startMatch,
44 std::vector<QString> & result, bool discardSwig=true) const;
48 #endif /* PYCONSOLE_ENHINTERP_H_ */