~brendan-donegan/checkbox/bug1085219

« back to all changes in this revision

Viewing changes to hwtest_cli/cli_interface.py

  • Committer: Marc Tardif
  • Date: 2007-10-04 23:12:10 UTC
  • Revision ID: marc.tardif@canonical.com-20071004231210-unxckndkgndxfdp6
Refactored questions to use templates and scripts which fixes bug #149195.

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
        self.put("\n")
25
25
 
26
26
    def get(self, limit=1):
27
 
        file = sys.stdin.fileno()
28
 
        saved_attributes = termios.tcgetattr(file)
29
 
        attributes = termios.tcgetattr(file)
 
27
        fileno = sys.stdin.fileno()
 
28
        saved_attributes = termios.tcgetattr(fileno)
 
29
        attributes = termios.tcgetattr(fileno)
30
30
        attributes[3] = attributes[3] & ~(termios.ICANON)
31
31
        attributes[6][termios.VMIN] = 1
32
32
        attributes[6][termios.VTIME] = 0
33
 
        termios.tcsetattr(file, termios.TCSANOW, attributes)
 
33
        termios.tcsetattr(fileno, termios.TCSANOW, attributes)
34
34
 
35
35
        input = ''
36
36
        try:
40
40
                    break
41
41
                input += ch
42
42
        finally:
43
 
            termios.tcsetattr(file, termios.TCSANOW, saved_attributes)
 
43
            termios.tcsetattr(fileno, termios.TCSANOW, saved_attributes)
44
44
 
45
45
        self.put_newline()
46
46
        return input
158
158
            dialog = CLIInputDialog(question.name, text)
159
159
            data = dialog.run()
160
160
 
161
 
        question.create_answer(status, data)
 
161
        question.set_answer(status, data)
162
162
 
163
163
        return 1
164
164