Avogadro  1.1.0
/home/kitware/dashboards/avogadro/libavogadro/src/pythonscript.h
00001 /**********************************************************************
00002   Python - Gives us some Python helper stuff
00003 
00004   Copyright (C) 2008 by Donald Ephraim Curtis
00005   Copyright (C) 2008,2009 by Tim Vandermeersch
00006  
00007   This file is part of the Avogadro molecular editor project.
00008   For more information, see <http://avogadro.openmolecules.net/>
00009 
00010   Avogadro is free software; you can redistribute it and/or modify
00011   it under the terms of the GNU General Public License as published by
00012   the Free Software Foundation; either version 2 of the License, or
00013   (at your option) any later version.
00014 
00015   Avogadro is distributed in the hope that it will be useful,
00016   but WITHOUT ANY WARRANTY; without even the implied warranty of
00017   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00018   GNU General Public License for more details.
00019 
00020   You should have received a copy of the GNU General Public License
00021   along with this program; if not, write to the Free Software
00022   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
00023   02110-1301, USA.
00024  ***********************************************************************/
00025 
00026 #ifndef PYTHONSCRIPT_H
00027 #define PYTHONSCRIPT_H
00028 
00029 #include <avogadro/global.h>
00030 #include <boost/python.hpp>
00031 
00032 #include "pythonerror.h"
00033 
00034 #include <QList>
00035 #include <QDir>
00036 #include <QString>
00037 #include <QDateTime>
00038 #include <QFileInfo>
00039 #include <QTextEdit>
00040 
00041 namespace Avogadro {
00042 
00043   class A_EXPORT PythonScript
00044   {
00045 
00046     public:
00047       PythonScript(const QString &fileName);
00048       ~PythonScript();
00049 
00053       QString moduleName() const;
00057       boost::python::object module() const;
00061       const QString& fileName() const;
00066       QString identifier() const;
00067 
00068 
00069     private:
00070       QString m_moduleName;
00071       QString m_fileName;
00072       mutable QDateTime m_lastModified;
00073       mutable boost::python::object m_module;
00074   };
00075 
00076 } // end namespace Avogadro
00077 
00078 #endif