• File: utils.pyo
  • Full Path: /home3/farmfre2/public_html/ALFA_DATA/alfasymlink/root/lib/python2.7/site-packages/clcommon/utils.pyo
  • Date Modified: 06/01/2017 4:14 PM
  • File size: 2.09 KB
  • MIME-type: text/x-bytecode.python
  • Charset: 8 bit

b=0Yc@s;ddlZdefdYZddZdZdS(iNtExternalProgramFailedcBseZdZRS(cCstj||dS(N(t	Exceptiont__init__(tselftmessage((s2/usr/lib/python2.7/site-packages/clcommon/utils.pyRs(t__name__t
__module__R(((s2/usr/lib/python2.7/site-packages/clcommon/utils.pyRscCsdj|}y=tj|dtddtjdtjdtd|}Wn/tk
r}}td|t	|fnX|j
\}}|jd	krt|pd
||fn|S(sv
    Runs external process and returns output
    @param cmd: command and arguments as a list
    @return: string
    t tstdins	/dev/nulltstdouttstderrt	close_fdstenvs%s. Can not run command: %sisoutput of the command: %s
%s(tjoint
subprocesstPopentopentPIPEtSTDOUTtTruetOSErrorRtstrtcommunicatet
returncode(tcmdtenv_datatcmd_linetoutputtoserrtstd_outtstd_err((s2/usr/lib/python2.7/site-packages/clcommon/utils.pytrun_commands		
 cCs}t}t|d}|j}|jdx4|D],}|d|kr[|j|q5t}q5W|j|j|S(s
    Delete line from file. Return True when line(s) have been deleted, False otherwise (specified line is not found)
    :param path: path to file
    :type path: string
    :param line: line to delete without EOL ('
')
    :type line: string
    :rtype bool
    sr+is%s
(tFalseRt	readlinestseektwriteRttruncatetclose(tpathtlinetfoundtftlinestl((s2/usr/lib/python2.7/site-packages/clcommon/utils.pytdelete_line_from_file#s	




(RRRtNoneRR,(((s2/usr/lib/python2.7/site-packages/clcommon/utils.pyt<module>s