OpendTect-6_4  6.4
Public Member Functions | Static Public Member Functions | Public Attributes | Private Member Functions | Static Private Member Functions | Private Attributes | Friends | List of all members
OD::PythonAccess Class Reference
Inheritance diagram for OD::PythonAccess:
[legend]

Public Member Functions

 PythonAccess ()
 
 ~PythonAccess ()
 
uiRetVal isUsable (bool force=false, const char *scriptstr=nullptr, const char *scriptexpectedout=nullptr) const
 
bool execute (const OS::MachineCommand &, bool wait4finish=true) const
 
bool execute (const OS::MachineCommand &, BufferString &stdoutstr, BufferString *stderrstr, uiString *errmsg=nullptr) const
 
bool execute (const OS::MachineCommand &, const OS::CommandExecPars &, int *pid=nullptr, uiString *errmsg=nullptr) const
 
BufferString lastOutput (bool stderrout, uiString *launchermsg) const
 
BufferString pyVersion () const
 
uiString pySummary () const
 
bool isModuleUsable (const char *nm) const
 
struct(Basic) ModuleInfo uiRetVal verifyEnvironment (const char *piname)
 
BufferString getPacmanExecNm () const
 
uiRetVal updateModuleInfo (const char *cmd="pip list")
 
uiRetVal hasModule (const char *modname, const char *minversion=0) const
 
uiRetVal getModules (ManagedObjectSet< ModuleInfo > &)
 
- Public Member Functions inherited from CallBacker
 CallBacker ()
 
 CallBacker (const CallBacker &)
 
virtual ~CallBacker ()
 
bool attachCB (NotifierAccess &, const CallBack &, bool onlyifnew=false)
 
bool attachCB (NotifierAccess *notif, const CallBack &cb, bool onlyifnew=false)
 
void detachCB (NotifierAccess &, const CallBack &)
 
void detachCB (NotifierAccess *notif, const CallBack &cb)
 
bool isNotifierAttached (NotifierAccess *) const
 Only for debugging purposes, don't use. More...
 

Static Public Member Functions

static bool hasInternalEnvironment (bool allowuserdef=true)
 
static bool validInternalEnvironment (const FilePath &)
 
static const char * sPythonExecNm (bool v3=false, bool v2=false)
 
static const char * sKeyPythonSrc ()
 
static const char * sKeyEnviron ()
 

Public Attributes

Notifier< PythonAccessenvChange
 

Private Member Functions

bool isUsable (bool force=false, const char *scriptstr=nullptr, const char *scriptexpectedout=nullptr)
 
bool isEnvUsable (const FilePath *pythonenvfp, const char *envnm, const char *scriptstr, const char *scriptexpectedout)
 
bool doExecute (const OS::MachineCommand &, const OS::CommandExecPars *, int *pid, const FilePath *activatefp, const char *envnm) const
 
bool retrievePythonVersionStr ()
 
void envChangeCB (CallBacker *)
 

Static Private Member Functions

static uiString tr (const char *text, const char *disambiguation=0, int pluralnr=-1)
 
static uiString legacyTr (const char *text, const char *disambiguation=0, int pluralnr=-1)
 
static bool getInternalEnvironmentLocation (FilePath &, bool userdef)
 
static FilePath getInternalEnvPath (bool userdef)
 
static bool getSortedVirtualEnvironmentLoc (ObjectSet< FilePath > &, BufferStringSet &envnms, const BufferString *envnm=nullptr, const FilePath *extroot=nullptr)
 
static FilePathgetCommand (OS::MachineCommand &, bool background, const FilePath *activatefp, const char *envnm)
 
static OS::CommandLaunchergetLauncher (const OS::MachineCommand &, bool background, const FilePath *activatefp, const char *envnm, FilePath &scriptfp)
 
static void getPIDFromFile (const char *pidfnm, int *pid)
 
static FilePathgetActivateScript (const FilePath &root)
 

Private Attributes

bool istested_ = false
 
bool isusable_ = false
 
FilePathactivatefp_ = nullptr
 
BufferString virtenvnm_
 
PtrMan< OS::CommandLaunchercl_
 
BufferString laststdout_
 
BufferString laststderr_
 
uiString msg_
 
BufferString pythversion_
 
ManagedObjectSet< ModuleInfo > moduleinfos_
 

Friends

class ::uiPythonSettings
 

Additional Inherited Members

- Protected Member Functions inherited from CallBacker
void detachAllNotifiers ()
 Call from the destructor of your inherited object. More...
 

Detailed Description

Constructor & Destructor Documentation

OD::PythonAccess::PythonAccess ( )
OD::PythonAccess::~PythonAccess ( )

Member Function Documentation

bool OD::PythonAccess::doExecute ( const OS::MachineCommand ,
const OS::CommandExecPars ,
int *  pid,
const FilePath activatefp,
const char *  envnm 
) const
private
void OD::PythonAccess::envChangeCB ( CallBacker )
private
bool OD::PythonAccess::execute ( const OS::MachineCommand ,
bool  wait4finish = true 
) const
bool OD::PythonAccess::execute ( const OS::MachineCommand ,
BufferString stdoutstr,
BufferString stderrstr,
uiString errmsg = nullptr 
) const
bool OD::PythonAccess::execute ( const OS::MachineCommand ,
const OS::CommandExecPars ,
int *  pid = nullptr,
uiString errmsg = nullptr 
) const
static FilePath* OD::PythonAccess::getActivateScript ( const FilePath root)
staticprivate
static FilePath* OD::PythonAccess::getCommand ( OS::MachineCommand ,
bool  background,
const FilePath activatefp,
const char *  envnm 
)
staticprivate
static bool OD::PythonAccess::getInternalEnvironmentLocation ( FilePath ,
bool  userdef 
)
staticprivate
static FilePath OD::PythonAccess::getInternalEnvPath ( bool  userdef)
staticprivate
static OS::CommandLauncher* OD::PythonAccess::getLauncher ( const OS::MachineCommand ,
bool  background,
const FilePath activatefp,
const char *  envnm,
FilePath scriptfp 
)
staticprivate
uiRetVal OD::PythonAccess::getModules ( ManagedObjectSet< ModuleInfo > &  )
BufferString OD::PythonAccess::getPacmanExecNm ( ) const
static void OD::PythonAccess::getPIDFromFile ( const char *  pidfnm,
int *  pid 
)
staticprivate
static bool OD::PythonAccess::getSortedVirtualEnvironmentLoc ( ObjectSet< FilePath > &  ,
BufferStringSet envnms,
const BufferString envnm = nullptr,
const FilePath extroot = nullptr 
)
staticprivate
static bool OD::PythonAccess::hasInternalEnvironment ( bool  allowuserdef = true)
static
uiRetVal OD::PythonAccess::hasModule ( const char *  modname,
const char *  minversion = 0 
) const
bool OD::PythonAccess::isEnvUsable ( const FilePath pythonenvfp,
const char *  envnm,
const char *  scriptstr,
const char *  scriptexpectedout 
)
private
bool OD::PythonAccess::isModuleUsable ( const char *  nm) const
uiRetVal OD::PythonAccess::isUsable ( bool  force = false,
const char *  scriptstr = nullptr,
const char *  scriptexpectedout = nullptr 
) const
bool OD::PythonAccess::isUsable ( bool  force = false,
const char *  scriptstr = nullptr,
const char *  scriptexpectedout = nullptr 
)
private
BufferString OD::PythonAccess::lastOutput ( bool  stderrout,
uiString launchermsg 
) const
static uiString OD::PythonAccess::legacyTr ( const char *  text,
const char *  disambiguation = 0,
int  pluralnr = -1 
)
inlinestaticprivate
uiString OD::PythonAccess::pySummary ( ) const
BufferString OD::PythonAccess::pyVersion ( ) const
bool OD::PythonAccess::retrievePythonVersionStr ( )
private
static const char* OD::PythonAccess::sKeyEnviron ( )
static
static const char* OD::PythonAccess::sKeyPythonSrc ( )
static
static const char* OD::PythonAccess::sPythonExecNm ( bool  v3 = false,
bool  v2 = false 
)
static
static uiString OD::PythonAccess::tr ( const char *  text,
const char *  disambiguation = 0,
int  pluralnr = -1 
)
inlinestaticprivate
uiRetVal OD::PythonAccess::updateModuleInfo ( const char *  cmd = "pip list")
static bool OD::PythonAccess::validInternalEnvironment ( const FilePath )
static
struct (Basic) ModuleInfo uiRetVal OD::PythonAccess::verifyEnvironment ( const char *  piname)

Friends And Related Function Documentation

friend class ::uiPythonSettings
friend

Member Data Documentation

FilePath* OD::PythonAccess::activatefp_ = nullptr
private
PtrMan<OS::CommandLauncher> OD::PythonAccess::cl_
mutableprivate
Notifier<PythonAccess> OD::PythonAccess::envChange
bool OD::PythonAccess::istested_ = false
private
bool OD::PythonAccess::isusable_ = false
private
BufferString OD::PythonAccess::laststderr_
mutableprivate
BufferString OD::PythonAccess::laststdout_
mutableprivate
ManagedObjectSet<ModuleInfo> OD::PythonAccess::moduleinfos_
private
uiString OD::PythonAccess::msg_
mutableprivate
BufferString OD::PythonAccess::pythversion_
private
BufferString OD::PythonAccess::virtenvnm_
private

Generated at for the OpendTect seismic interpretation project. Copyright (C): dGB Beheer B. V. 2019