<s> """<STR_LIT>""" <EOL> import functools <EOL> import urwid <EOL> from taiga_ncurses . ui . widgets import generic , projects <EOL> from . import base <EOL> from . backlog import ProjectBacklogSubView <EOL> from . milestones import ProjectMilestoneSubView <EOL> from . issues import ProjectIssuesSubView <EOL> from . wiki import ProjectWikiSubView <EOL> class ProjectsView ( base . View ) : <EOL> project_buttons = None <EOL> projects = None <EOL> def __init__ ( self ) : <EOL> self . projects = [ ] <EOL> self . project_buttons = [ ] <EOL> grid = generic . Grid ( [ ] , <NUM_LIT:4> , <NUM_LIT:2> , <NUM_LIT:2> , '<STR_LIT>' ) <EOL> fill = urwid . Filler ( grid , min_height = <NUM_LIT> ) <EOL> self . notifier = generic . FooterNotifier ( "<STR_LIT>" ) <EOL> self . widget = urwid . Frame ( fill , <EOL> header = generic . Header ( ) , <EOL> footer = generic . Footer ( self . notifier ) ) <EOL> def populate ( self , projects ) : <EOL> self . projects = projects <EOL> self . project_buttons = [ urwid . Button ( p [ '<STR_LIT:name>' ] ) for p in projects ] <EOL> min_width = functools . reduce ( max , ( len ( p [ '<STR_LIT:name>' ] ) for p in projects ) , <NUM_LIT:0> ) <EOL> grid = generic . Grid ( self . project_buttons , min_width * <NUM_LIT:4> , <NUM_LIT:2> , <NUM_LIT:2> , '<STR_LIT>' ) <EOL> self . widget . set_body ( urwid . Filler ( grid , min_height = <NUM_LIT> ) ) <EOL> class ProjectDetailView ( base . View ) : <EOL> TABS = [ "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" ] <EOL> def __init__ ( self , project ) : <EOL> self . project = project <EOL> self . notifier = generic . FooterNotifier ( "<STR_LIT>" ) <EOL> self . tabs = generic . Tabs ( self . TABS ) <EOL> self . backlog = ProjectBacklogSubView ( self , project , self . notifier , self . tabs ) <EOL> self . sprint = ProjectMilestoneSubView ( self , project , self . notifier , self . tabs ) <EOL> self . issues = ProjectIssuesSubView ( self , project , self . notifier , self . tabs ) <EOL> self . wiki = ProjectWikiSubView ( self , project , self . notifier , self . tabs ) <EOL> self . admin = ProjectAdminSubView ( self , project , self . notifier , self . tabs ) <EOL> self . widget = urwid . Frame ( self . backlog . widget , <EOL> header = projects . ProjectDetailHeader ( project ) , <EOL> footer = generic . Footer ( self . notifier ) ) <EOL> def backlog_view ( self ) : <EOL> self . tabs . tab_list . focus = <NUM_LIT:0> <EOL> self . widget . set_body ( self . backlog . widget ) <EOL> def sprint_view ( self ) : <EOL> self . tabs . tab_list . focus = <NUM_LIT:1> <EOL> self . widget . set_body ( self . sprint . widget ) <EOL> def issues_view ( self ) : <EOL> self . tabs . tab_list . focus = <NUM_LIT:2> <EOL> self . widget . set_body ( self . issues . widget ) <EOL> def wiki_view ( self ) : <EOL> self . tabs . tab_list . focus = <NUM_LIT:3> <EOL> self . widget . set_body ( self . wiki . widget ) <EOL> def admin_view ( self ) : <EOL> self . tabs . tab_list . focus = <NUM_LIT:4> <EOL> self . widget . set_body ( self . admin . widget ) <EOL> class ProjectAdminSubView ( base . SubView ) : <EOL> def __init__ ( self , parent_view , project , notifier , tabs ) : <EOL> super ( ) . __init__ ( parent_view ) <EOL> self . project = project <EOL> self . notifier = notifier <EOL> self . widget = urwid . ListBox ( urwid . SimpleListWalker ( [ <EOL> tabs , <EOL> generic . box_solid_fill ( "<STR_LIT:U+0020>" , <NUM_LIT:1> ) , <EOL> ] ) ) </s>
