+ def enter_ascii_art(command, height, width, with_pw=False):
+ if len(self.input_) > width:
+ self.log_msg('? wrong input length, '
+ 'must be max %s; try again' % width)
+ return
+ if len(self.input_) < width:
+ self.input_ += ' ' * (width - len(self.input_))
+ self.log_msg(' ' + self.input_)
+ self.full_ascii_draw += self.input_
+ self.ascii_draw_stage += 1
+ if self.ascii_draw_stage < height:
+ self.restore_input_values()
+ else:
+ if with_pw:
+ self.send('%s %s %s' % (command, quote(self.full_ascii_draw),
+ quote(self.password)))
+ else:
+ self.send('%s %s' % (command, quote(self.full_ascii_draw)))
+ self.full_ascii_draw = ""
+ self.ascii_draw_stage = 0
+ self.input_ = ""
+ self.switch_mode('edit')
+