pynoto / src / PythonCode / PythonCode.h

#ifndef _PYTHON3ROPE_H_
#define _PYTHON3ROPE_H_
#include <QProcess>
#include <QTcpSocket>
#include <QEventLoop>
#include "Include/IPythonCode.h"

class QDomNodeList;

namespace PythonCode {

class PythonCode : public IPythonCode
{
    Q_OBJECT
public:
    PythonCode();
    virtual ~PythonCode();

    virtual void init(const QString& interpret, const QString& projectPath, const QString& mainScript, const QString& projectFile, const QStringList& extraPathes);
    virtual void codeComplit(const QString& fileName, const QString& cnt, int pos);
    virtual void errorList(const QString& fileName, const QString & content);
    virtual void close();
private:
    void sendSyncRequest(const QString& req);
    void sendAsyncRequest(const QString& req);
    QString createRequest(const QString& name, const QVariantList& params);
    QString createRequest(const QString& name, const QString& inst, const QVariantList& params);
    void waitForResponce(int cmdNum);
    void parseAndEmitSignal(const QString& name, const QDomNodeList& items);
    void parseAndEmitErrorList(const QDomNodeList& items);
    void parseAndEmitCodeComplit(const QDomNodeList& items);
    IPythonCode::CompletitionType getType(const QString & named);
private slots:
    void onRunError(QProcess::ProcessError);
    void onError();
    void onRead();
    void onSocReadyRead();
    void onCmdRead(int);
signals:
    void cmdRead(int cmd);
private:
    QProcess *_proc;
    QTcpSocket *_soc;
    int _cmdNum;
    QEventLoop _loop;
};

}

#endif
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.