Beispiel #1
0
def getPythonCommand(scriptfile,posargs=None,dict=None,args=None):
  cmd = list()
  cmd.append( getPythonExecNm() )
  cmd.append( scriptfile )
  cmd = appendDtectArgs( cmd, args )
  cmd.append( '--dtectexec' )
  cmd.append( getExecPlfDir(args) )
  if args != None and 'proclog' in args:
    cmd.append( '--proclog' )
    cmd.append( args['proclog'] )
  if args != None and 'syslog' in args:
    cmd.append( '--syslog' )
    cmd.append( args['syslog'] )
  for posarg in posargs:
    cmd.append( posarg )
  if dict != None:
    cmd.append( '--dict' )
    cmd.append( json.dumps(dict) )
  return cmd
Beispiel #2
0
def getPythonCommand(scriptfile, posargs=None, dict=None, args=None):
    cmd = list()
    cmd.append(getPythonExecNm())
    cmd.append(scriptfile)
    cmd = appendDtectArgs(cmd, args)
    cmd.append('--dtectexec')
    cmd.append(getExecPlfDir(args))
    if args != None and 'proclog' in args:
        cmd.append('--proclog')
        cmd.append(args['proclog'])
    if args != None and 'syslog' in args:
        cmd.append('--syslog')
        cmd.append(args['syslog'])
    for posarg in posargs:
        cmd.append(posarg)
    if dict != None:
        cmd.append('--dict')
        cmd.append(json.dumps(dict))
    return cmd
Beispiel #3
0
def getPythonCommand(scriptfile, posargs=None, dict=None, args=None):
    """Python command line

  Parameters:
    * scriptfile (str): Python script or executable
    * posargs (list, optional): 
      Positional arguments for that script (default is None)
    * dict (str, optional): Value for the argument with key "--dict":
      String from which a json object can be parsed (default is None)
    * args (dict):
      Dictionary with the members 'dtectdata' and 'survey' as 
      single element lists, and/or 'dtectexec' (see odpy.getODSoftwareDir).
      The dictionary may also contain the members 'proclog' and 'syslog' as 
      strings, each being the full path to a log file.

  Returns:
    * list: 
      Fully formed command line to be executed by the python executable

  """

    cmd = list()
    cmd.append(getPythonExecNm())
    cmd.append(scriptfile)
    cmd = appendDtectArgs(cmd, args)
    cmd.append('--dtectexec')
    cmd.append(getExecPlfDir(args))
    if args != None and 'proclog' in args:
        cmd.append('--proclog')
        cmd.append(args['proclog'])
    if args != None and 'syslog' in args:
        cmd.append('--syslog')
        cmd.append(args['syslog'])
    for posarg in posargs:
        cmd.append(posarg)
    if dict != None:
        cmd.append('--dict')
        cmd.append(json.dumps(dict))
    return cmd
Beispiel #4
0
def getODCommand(execnm, args=None):
    """OpendTect command

  For a given OpendTect executable, get its full command line

  Parameters:
    * execnm (list): [Executable name]
    * arg (dict, optional):
      Dictionary with the members 'dtectdata' and 'survey' as 
      single element lists, and/or 'dtectexec' (see odpy.getODSoftwareDir)

  Returns:
    * list: OpendTect command line

  Notes:
    The two standard arguments providing the current survey location
    will be added to the command line arguments.

  Examples:
    >>> args = {
      'dtectdata': ['D:\\ODData'],
      'survey': ['F3_Demo']
    }

    >>> getODCommand()
    ['C:\\Program Files\\OpendTect\\6.6.0\\bin\win64\Release\\od_process_attrib',
    '--dataroot',
    'D:\\ODData',
    '--survey',
    'F3_Demo']

  """

    cmd = list()
    cmd.append(os.path.join(getExecPlfDir(args), execnm))
    return appendDtectArgs(cmd, args)
Beispiel #5
0
def getODCommand(execnm,args=None):
  cmd = list()
  cmd.append( os.path.join(getExecPlfDir(args),execnm) )
  return appendDtectArgs( cmd, args )
Beispiel #6
0
def getODCommand(execnm, args=None):
    cmd = list()
    cmd.append(os.path.join(getExecPlfDir(args), execnm))
    return appendDtectArgs(cmd, args)