Lines Matching refs:self
98 def __init__(self, cmd):
101 pexpect.spawn.__init__(self, cmd)
106 self.full_output = ""
107 self.quick_timeout = 15
110 self.expect('\$ ', options.oarsub_timeout)
113 self.kill(9)
114 self.safe_close()
116 self.do_command('unset PROMPT_COMMAND; PS1="qdo$ "')
119 def expect(self, regexp, timeout = -1):
120 pexpect.spawn.expect(self, regexp, timeout)
121 self.full_output += self.before + self.after
125 def do_bare_command(self, cmd, timeout = -1):
127 self.sendline(cmd)
129 self.readline()
131 self.expect(self.prompt_re, timeout)
132 output = self.before.rstrip()
137 def do_command(self, cmd, timeout = -1):
139 output = self.do_bare_command(cmd, timeout)
141 status = int(self.do_bare_command("echo $?", self.quick_timeout))
145 def dir_exists(self, dirname):
147 self.quick_timeout)
154 def safe_close(self):
156 while self.isalive() and count < 10:
158 self.close(force=False)