Beispiel #1
0
 def bottom_bar(self, msg=u''):
     self.frame.write(''.join([ac.move2(24, 1), ac.kill_to_end,
                               ac.outlook(ac.art_code['bg_blue'],
                                          ac.art_code['yellow'],
                                          ac.art_code['bold']),
                               msg, ac.reset]))
     self.fix_cursor()
Beispiel #2
0
 def initialize(self):
     self.write(''.join([
                 ac.clear,
                 ac.move2(10, 50),
                 ac.outlook(ac.art_code['red'], ac.art_code['bold']),
                 'M M S S G G',
                 ac.reset]))
     self.menu = self.load(ColMenu)  # 记住要先import ColMenu
     self.menu.setup([
             ['show_message', 'set_message', 'delete_self', 'bye'],
             [(8,20), (10,22), (12, 24), (14, 26)],
             {'a':0, 'b':1, 'c':2, 'd': 3},
             [u'a. 查看留言', u'b. 设置留言', u'c. 删除资料', u'd. 离开系统'],
             ])
     self.menu.restore()
Beispiel #3
0
class BaseFrame(Frame):

    pause_prompt = '%s%s%s%s' % (ac.move2(
        24, 20), ac.outlook(ac.art_code['yellow'],
                            ac.art_code['blink']), '任意键继续', ac.reset)

    def set_title(self, msg):
        self.write(''.join([ac.clear, ac.move2(1, 1), msg]))

    def wrong(self, msg):
        self.writeln(u'%s%s%s' % (ac.red, msg, ac.reset))

    def warnning(self, msg):
        self.writeln(u'%s%s%s' % (ac.yellow, msg, ac.reset))

    def success(self, msg):
        self.writeln(u'%s%s%s' % (ac.green, msg, ac.reset))

    def pause(self):
        super(BaseFrame, self).pause(prompt=self.pause_prompt)
Beispiel #4
0
 def message(self, message):
     self.frame.write(''.join([ac.move2(24, 1), ac.kill_to_end,
                               ac.outlook(ac.art_code['bg_blue'],
                                          ac.art_code['yellow'],
                                          ac.art_code['bold']),
                               message, ac.reset]))