story.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:boartty 作者: openstack 项目源码 文件源码
def __init__(self, app, story_view, task):
        super(TaskRow, self).__init__(urwid.Pile([]))
        self.app = app
        self.story_view = story_view
        self.task_key = task.key
        self._note = u''
        self.taskid = mywid.TextButton(self._note)
        urwid.connect_signal(self.taskid, 'click',
                             lambda b:self.editNote(b))
        self.project = ProjectButton(self.app)
        urwid.connect_signal(self.project, 'changed',
                             lambda b:self.updateProject(b))
        self.status = StatusButton(self.app)
        urwid.connect_signal(self.status, 'changed',
                             lambda b:self.updateStatus(b))
        self._title = u''
        self.title = mywid.TextButton(self._title)
        urwid.connect_signal(self.title, 'click',
                             lambda b:self.editTitle(b))
        self.assignee = AssigneeButton(self.app)
        urwid.connect_signal(self.assignee, 'changed',
                             lambda b:self.updateAssignee(b))
        self.description = urwid.Text(u'')
        self.columns = urwid.Columns([], dividechars=1)

        for (widget, attr, packing) in [
                (self.taskid, 'task-id', ('given', 4, False)),
                (self.project, 'task-project', ('weight', 1, False)),
                (self.title, 'task-title', ('weight', 2, False)),
                (self.status, 'task-status', ('weight', 1, False)),
                (self.assignee, 'task-assignee', ('weight', 1, False)),
        ]:
            w = urwid.AttrMap(urwid.Padding(widget, width='pack'), attr,
                              focus_map={'focused': 'focused-'+attr})
            self.columns.contents.append((w, packing))
        self.pile = urwid.Pile([self.columns])
        self.note = urwid.Text(u'')
        self.note_visible = False
        self.note_columns = urwid.Columns([], dividechars=1)
        self.note_columns.contents.append((urwid.Text(u''), ('given', 1, False)))
        self.note_columns.contents.append((self.note, ('weight', 1, False)))
        self._w = urwid.AttrMap(self.pile, None)#, focus_map=self.task_focus_map)
        self.refresh(task)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号