1 // Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 // Author : Adrien Bruneton (CEA/DEN)
20 // Created on: 4 avr. 2013
23 #ifndef PYCONSOLE_ENHINTERP_H_
24 #define PYCONSOLE_ENHINTERP_H_
26 #include "PyConsole.h"
29 #include "PyConsole_Interp.h"
35 * Enhanced Python interpreter used for auto-completion.
36 * This extends PyConsole_Interp with an API wrapping the Python dir() command nicely.
38 class PYCONSOLE_EXPORT PyConsole_EnhInterp: public PyConsole_Interp
41 PyConsole_EnhInterp();
42 virtual ~PyConsole_EnhInterp();
44 virtual QStringList getLastMatches() const;
45 virtual QString getDocStr() const;
47 virtual int runDirCommand(const QString& dirArgument, const QString& startMatch);
48 virtual void clearCompletion();
51 /** Hard coded list of Python keywords */
52 static const std::vector<QString> PYTHON_KEYWORDS;
54 /** Last computed matches */
55 QStringList _last_matches;
56 /** Doc string of the first match - when only one match it will be displayed by the Editor*/
59 virtual int runDirAndExtract(const QString& dirArgument, const QString& startMatch,
60 QStringList& result, bool discardSwig=true) const;
63 #endif /* PYCONSOLE_ENHINTERP_H_ */