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.
18 class PYCONSOLE_EXPORT PyConsole_EnhInterp: public PyConsole_Interp
22 : PyConsole_Interp(), _last_matches(0), _doc_str("")
25 virtual ~PyConsole_EnhInterp() {}
27 const std::vector<QString>& getLastMatches() const { return _last_matches; }
28 const QString & getDocStr() const { return _doc_str; }
30 virtual int runDirCommand(const QString& dirArgument, const QString& startMatch);
31 virtual void clearCompletion();
34 /** Hard coded list of Python keywords */
35 static const std::vector<QString> PYTHON_KEYWORDS;
37 /** Last computed matches */
38 std::vector<QString> _last_matches;
39 /** Doc string of the first match - when only one match it will be displayed by the Editor*/
42 virtual int runDirAndExtract(const QString& dirArgument, const QString & startMatch,
43 std::vector<QString> & result, bool discardSwig=true) const;
47 #endif /* PYCONSOLE_ENHINTERP_H_ */