original_docstring:  
          Runs a tool and specifies tool arguments.
          Returns 0 if completes without error.
          Returns 1 if error encountered (details are sent to callback).
          Returns 2 if process is cancelled by user.
          
docstring: Runs a tool and specifies tool arguments.
  Returns 0 if completes without error.
  Returns 1 if error encountered (details are sent to callback).
  Returns 2 if process is cancelled by user.
docstring_tokens: Runs a tool and specifies tool arguments . Returns 0 if completes without error . Returns 1 if error encountered ( details are sent to callback ) . Returns 2 if process is cancelled by user .
code: def run_tool(self, tool_name, args, callback=default_callback):
          ''' 
          Runs a tool and specifies tool arguments.
          Returns 0 if completes without error.
          Returns 1 if error encountered (details are sent to callback).
          Returns 2 if process is cancelled by user.
          '''
          try:
              os.chdir(self.exe_path)
              args2 = []
              args2.append("." + path.sep + self.exe_name)
              args2.append("--run=\"{}\"".format(to_camelcase(tool_name)))
  
              if self.work_dir.strip() != "":
                  args2.append("--wd=\"{}\"".format(self.work_dir))
  
              for arg in args:
                  args2.append(arg)
  
              # args_str = args_str[:-1]
              # a.append("--args=\"{}\"".format(args_str))
  
              if self.verbose:
                  args2.append("-v")
  
              if self.verbose:
                  cl = ""
                  for v in args2:
                      cl += v + " "
                  callback(cl.strip() + "\n")
  
              proc = Popen(args2, shell=False, stdout=PIPE,
                           stderr=STDOUT, bufsize=1, universal_newlines=True)
  
              while True:
                  line = proc.stdout.readline()
                  sys.stdout.flush()
                  if line != '':
                      if not self.cancel_op:
                          callback(line.strip())
                      else:
                          self.cancel_op = False
                          proc.terminate()
                          return 2
  
                  else:
                      break
  
              return 0
          except (OSError, ValueError, CalledProcessError) as err:
              callback(str(err))
              return 1
code_tokens: def run_tool ( self , tool_name , args , callback = default_callback ) : try : os . chdir ( self . exe_path ) args2 = [ ] args2 . append ( "." + path . sep + self . exe_name ) args2 . append ( "--run=\"{}\"" . format ( to_camelcase ( tool_name ) ) ) if self . work_dir . strip ( ) != "" : args2 . append ( "--wd=\"{}\"" . format ( self . work_dir ) ) for arg in args : args2 . append ( arg ) if self . verbose : args2 . append ( "-v" ) if self . verbose : cl = "" for v in args2 : cl += v + " " callback ( cl . strip ( ) + "\n" ) proc = Popen ( args2 , shell = False , stdout = PIPE , stderr = STDOUT , bufsize = 1 , universal_newlines = True ) while True : line = proc . stdout . readline ( ) sys . stdout . flush ( ) if line != '' : if not self . cancel_op : callback ( line . strip ( ) ) else : self . cancel_op = False proc . terminate ( ) return 2 else : break return 0 except ( OSError , ValueError , CalledProcessError ) as err : callback ( str ( err ) ) return 1
short_docstring: Runs a tool and specifies tool arguments.
short_docstring_tokens: Runs a tool and specifies tool arguments .
comment: ''' 
          Runs a tool and specifies tool arguments.
          Returns 0 if completes without error.
          Returns 1 if error encountered (details are sent to callback).
          Returns 2 if process is cancelled by user.
          '''$SEP$# args_str = args_str[:-1]$SEP$# a.append("--args=\"{}\"".format(args_str))