<s> import logging <EOL> import urwid <EOL> from gertty import keymap <EOL> from gertty import mywid <EOL> from gertty import sync <EOL> from gertty . view import change_list as view_change_list <EOL> from gertty . view import mouse_scroll_decorator <EOL> class TopicSelectDialog ( urwid . WidgetWrap ) : <EOL> signals = [ '<STR_LIT>' , '<STR_LIT>' ] <EOL> def __init__ ( self , title , topics ) : <EOL> button_widgets = [ ] <EOL> ok_button = mywid . FixedButton ( '<STR_LIT:OK>' ) <EOL> cancel_button = mywid . FixedButton ( '<STR_LIT>' ) <EOL> urwid . connect_signal ( ok_button , '<STR_LIT>' , <EOL> lambda button : self . _emit ( '<STR_LIT>' ) ) <EOL> urwid . connect_signal ( cancel_button , '<STR_LIT>' , <EOL> lambda button : self . _emit ( '<STR_LIT>' ) ) <EOL> button_widgets . append ( ( '<STR_LIT>' , ok_button ) ) <EOL> button_widgets . append ( ( '<STR_LIT>' , cancel_button ) ) <EOL> button_columns = urwid . Columns ( button_widgets , dividechars = <NUM_LIT:2> ) <EOL> self . topic_buttons = [ ] <EOL> self . topic_keys = { } <EOL> rows = [ ] <EOL> for key , name in topics : <EOL> button = mywid . FixedRadioButton ( self . topic_buttons , name ) <EOL> self . topic_keys [ button ] = key <EOL> rows . append ( button ) <EOL> rows . append ( urwid . Divider ( ) ) <EOL> rows . append ( button_columns ) <EOL> pile = urwid . Pile ( rows ) <EOL> fill = urwid . Filler ( pile , valign = '<STR_LIT>' ) <EOL> super ( TopicSelectDialog , self ) . __init__ ( urwid . LineBox ( fill , title ) ) <EOL> def getSelected ( self ) : <EOL> for b in self . topic_buttons : <EOL> if b . state : <EOL> return self . topic_keys [ b ] <EOL> return None <EOL> class ProjectRow ( urwid . Button ) : <EOL> project_focus_map = { None : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> } <EOL> def selectable ( self ) : <EOL> return True <EOL> def _setName ( self , name , indent ) : <EOL> self . project_name = name <EOL> name = indent + name <EOL> if self . mark : <EOL> name = '<STR_LIT:%>' + name <EOL> else : <EOL> name = '<STR_LIT:U+0020>' + name <EOL> self . name . set_text ( name ) <EOL> def __init__ ( self , app , project , topic , callback = None ) : <EOL> super ( ProjectRow , self ) . __init__ ( '<STR_LIT>' , on_press = callback , <EOL> user_data = ( project . key , project . name ) ) <EOL> self . app = app <EOL> self . mark = False <EOL> self . _style = None <EOL> self . project_key = project . key <EOL> if topic : <EOL> self . topic_key = topic . key <EOL> self . indent = '<STR_LIT:U+0020>' <EOL> else : <EOL> self . topic_key = None <EOL> self . indent = '<STR_LIT>' <EOL> self . project_name = project . name <EOL> self . name = urwid . Text ( '<STR_LIT>' ) <EOL> self . _setName ( project . name , self . indent ) <EOL> self . name . set_wrap_mode ( '<STR_LIT>' ) <EOL> self . unreviewed_changes = urwid . Text ( u'<STR_LIT>' , align = urwid . RIGHT ) <EOL> self . open_changes = urwid . Text ( u'<STR_LIT>' , align = urwid . RIGHT ) <EOL> col = urwid . Columns ( [ <EOL> self . name , <EOL> ( '<STR_LIT>' , <NUM_LIT:11> , self . unreviewed_changes ) , <EOL> ( '<STR_LIT>' , <NUM_LIT:5> , self . open_changes ) , <EOL> ] ) <EOL> self . row_style = urwid . AttrMap ( col , '<STR_LIT>' ) <EOL> self . _w = urwid . AttrMap ( self . row_style , None , focus_map = self . project_focus_map ) <EOL> self . update ( project ) <EOL> def update ( self , project ) : <EOL> cache = self . app . project_cache . get ( project ) <EOL> if project . subscribed : <EOL> if cache [ '<STR_LIT>' ] > <NUM_LIT:0> : <EOL> style = '<STR_LIT>' <EOL> else : <EOL> style = '<STR_LIT>' <EOL> else : <EOL> style = '<STR_LIT>' <EOL> self . _style = style <EOL> if self . mark : <EOL> style = '<STR_LIT>' <EOL> self . row_style . set_attr_map ( { None : style } ) <EOL> self . unreviewed_changes . set_text ( '<STR_LIT>' % cache [ '<STR_LIT>' ] ) <EOL> self . open_changes . set_text ( '<STR_LIT>' % cache [ '<STR_LIT>' ] ) <EOL> def toggleMark ( self ) : <EOL> self . mark = not self . mark <EOL> if self . mark : <EOL> style = '<STR_LIT>' <EOL> else : <EOL> style = self . _style <EOL> self . row_style . set_attr_map ( { None : style } ) <EOL> self . _setName ( self . project_name , self . indent ) <EOL> class TopicRow ( urwid . Button ) : <EOL> project_focus_map = { None : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> } <EOL> def selectable ( self ) : <EOL> return True <EOL> def _setName ( self , name ) : <EOL> self . topic_name = name <EOL> name = '<STR_LIT>' + name + '<STR_LIT>' <EOL> if self . mark : <EOL> name = '<STR_LIT:%>' + name <EOL> else : <EOL> name = '<STR_LIT:U+0020>' + name <EOL> self . name . set_text ( name ) <EOL> def __init__ ( self , topic , callback = None ) : <EOL> super ( TopicRow , self ) . __init__ ( '<STR_LIT>' , on_press = callback , <EOL> user_data = ( topic . key , topic . name ) ) <EOL> self . mark = False <EOL> self . _style = None <EOL> self . topic_key = topic . key <EOL> self . name = urwid . Text ( '<STR_LIT>' ) <EOL> self . _setName ( topic . name ) <EOL> self . name . set_wrap_mode ( '<STR_LIT>' ) <EOL> self . unreviewed_changes = urwid . Text ( u'<STR_LIT>' , align = urwid . RIGHT ) <EOL> self . open_changes = urwid . Text ( u'<STR_LIT>' , align = urwid . RIGHT ) <EOL> col = urwid . Columns ( [ <EOL> self . name , <EOL> ( '<STR_LIT>' , <NUM_LIT:11> , self . unreviewed_changes ) , <EOL> ( '<STR_LIT>' , <NUM_LIT:5> , self . open_changes ) , <EOL> ] ) <EOL> self . row_style = urwid . AttrMap ( col , '<STR_LIT>' ) <EOL> self . _w = urwid . AttrMap ( self . row_style , None , focus_map = self . project_focus_map ) <EOL> self . _style = '<STR_LIT>' <EOL> self . row_style . set_attr_map ( { None : self . _style } ) <EOL> self . update ( topic ) <EOL> def update ( self , topic , unreviewed_changes = None , open_changes = None ) : <EOL> self . _setName ( topic . name ) <EOL> if unreviewed_changes is None : <EOL> self . unreviewed_changes . set_text ( '<STR_LIT>' ) <EOL> else : <EOL> self . unreviewed_changes . set_text ( '<STR_LIT>' % unreviewed_changes ) <EOL> if open_changes is None : <EOL> self . open_changes . set_text ( '<STR_LIT>' ) <EOL> else : <EOL> self . open_changes . set_text ( '<STR_LIT>' % open_changes ) <EOL> def toggleMark ( self ) : <EOL> self . mark = not self . mark <EOL> if self . mark : <EOL> style = '<STR_LIT>' <EOL> else : <EOL> style = self . _style <EOL> self . row_style . set_attr_map ( { None : style } ) <EOL> self . _setName ( self . topic_name ) <EOL> class ProjectListHeader ( urwid . WidgetWrap ) : <EOL> def __init__ ( self ) : <EOL> cols = [ urwid . Text ( u'<STR_LIT>' ) , <EOL> ( <NUM_LIT:11> , urwid . Text ( u'<STR_LIT>' ) ) , <EOL> ( <NUM_LIT:5> , urwid . Text ( u'<STR_LIT>' ) ) ] <EOL> super ( ProjectListHeader , self ) . __init__ ( urwid . Columns ( cols ) ) <EOL> @ mouse_scroll_decorator . ScrollByWheel <EOL> class ProjectListView ( urwid . WidgetWrap ) : <EOL> def help ( self ) : <EOL> key = self . app . config . keymap . formatKeys <EOL> return [ <EOL> ( key ( keymap . TOGGLE_LIST_SUBSCRIBED ) , <EOL> "<STR_LIT>" ) , <EOL> ( key ( keymap . TOGGLE_LIST_REVIEWED ) , <EOL> "<STR_LIT>" ) , <EOL> ( key ( keymap . TOGGLE_SUBSCRIBED ) , <EOL> "<STR_LIT>" ) , <EOL> ( key ( keymap . REFRESH ) , <EOL> "<STR_LIT>" ) , <EOL> ( key ( keymap . TOGGLE_MARK ) , <EOL> "<STR_LIT>" ) , <EOL> ( key ( keymap . NEW_PROJECT_TOPIC ) , <EOL> "<STR_LIT>" ) , <EOL> ( key ( keymap . DELETE_PROJECT_TOPIC ) , <EOL> "<STR_LIT>" ) , <EOL> ( key ( keymap . MOVE_PROJECT_TOPIC ) , <EOL> "<STR_LIT>" ) , <EOL> ( key ( keymap . COPY_PROJECT_TOPIC ) , <EOL> "<STR_LIT>" ) , <EOL> ( key ( keymap . REMOVE_PROJECT_TOPIC ) , <EOL> "<STR_LIT>" ) , <EOL> ( key ( keymap . RENAME_PROJECT_TOPIC ) , <EOL> "<STR_LIT>" ) , <EOL> ] <EOL> def __init__ ( self , app ) : <EOL> super ( ProjectListView , self ) . __init__ ( urwid . Pile ( [ ] ) ) <EOL> self . log = logging . getLogger ( '<STR_LIT>' ) <EOL> self . app = app <EOL> self . unreviewed = True <EOL> self . subscribed = True <EOL> self . project_rows = { } <EOL> self . topic_rows = { } <EOL> self . open_topics = set ( ) <EOL> self . listbox = urwid . ListBox ( urwid . SimpleFocusListWalker ( [ ] ) ) <EOL> self . header = ProjectListHeader ( ) <EOL> self . refresh ( ) <EOL> self . _w . contents . append ( ( app . header , ( '<STR_LIT>' , <NUM_LIT:1> ) ) ) <EOL> self . _w . contents . append ( ( urwid . Divider ( ) , ( '<STR_LIT>' , <NUM_LIT:1> ) ) ) <EOL> self . _w . contents . append ( ( urwid . AttrWrap ( self . header , '<STR_LIT>' ) , ( '<STR_LIT>' , <NUM_LIT:1> ) ) ) <EOL> self . _w . contents . append ( ( self . listbox , ( '<STR_LIT>' , <NUM_LIT:1> ) ) ) <EOL> self . _w . set_focus ( <NUM_LIT:3> ) <EOL> def interested ( self , event ) : <EOL> if not ( isinstance ( event , sync . ProjectAddedEvent ) <EOL> or <EOL> isinstance ( event , sync . ChangeAddedEvent ) <EOL> or <EOL> ( isinstance ( event , sync . ChangeUpdatedEvent ) and <EOL> ( event . status_changed or event . review_flag_changed ) ) ) : <EOL> self . log . debug ( "<STR_LIT>" % ( event , ) ) <EOL> return False <EOL> self . log . debug ( "<STR_LIT>" % ( event , ) ) <EOL> return True <EOL> def advance ( self ) : <EOL> pos = self . listbox . focus_position <EOL> if pos < len ( self . listbox . body ) - <NUM_LIT:1> : <EOL> pos += <NUM_LIT:1> <EOL> self . listbox . focus_position = pos <EOL> def _deleteRow ( self , row ) : <EOL> if row in self . listbox . body : <EOL> self . listbox . body . remove ( row ) <EOL> if isinstance ( row , ProjectRow ) : <EOL> del self . project_rows [ ( row . topic_key , row . project_key ) ] <EOL> else : <EOL> del self . topic_rows [ row . topic_key ] <EOL> def _projectRow ( self , i , project , topic ) : <EOL> topic_key = topic and topic . key or None <EOL> key = ( topic_key , project . key ) <EOL> row = self . project_rows . get ( key ) <EOL> while row : <EOL> if i >= len ( self . listbox . body ) : <EOL> break <EOL> current_row = self . listbox . body [ i ] <EOL> if ( isinstance ( current_row , ProjectRow ) and <EOL> current_row . project_key == project . key ) : <EOL> break <EOL> self . _deleteRow ( current_row ) <EOL> if not row : <EOL> row = ProjectRow ( self . app , project , topic , self . onSelect ) <EOL> self . listbox . body . insert ( i , row ) <EOL> self . project_rows [ key ] = row <EOL> else : <EOL> row . update ( project ) <EOL> return i + <NUM_LIT:1> <EOL> def _topicRow ( self , i , topic ) : <EOL> row = self . topic_rows . get ( topic . key ) <EOL> while row : <EOL> if i >= len ( self . listbox . body ) : <EOL> break <EOL> current_row = self . listbox . body [ i ] <EOL> if ( isinstance ( current_row , TopicRow ) and <EOL> current_row . topic_key == topic . key ) : <EOL> break <EOL> self . _deleteRow ( current_row ) <EOL> if not row : <EOL> row = TopicRow ( topic , self . onSelectTopic ) <EOL> self . listbox . body . insert ( i , row ) <EOL> self . topic_rows [ topic . key ] = row <EOL> else : <EOL> row . update ( topic ) <EOL> return i + <NUM_LIT:1> <EOL> def refresh ( self ) : <EOL> if self . subscribed : <EOL> self . title = u'<STR_LIT>' <EOL> if self . unreviewed : <EOL> self . title += u'<STR_LIT>' <EOL> else : <EOL> self . title = u'<STR_LIT>' <EOL> self . app . status . update ( title = self . title ) <EOL> with self . app . db . getSession ( ) as session : <EOL> i = <NUM_LIT:0> <EOL> for project in session . getProjects ( topicless = True , <EOL> subscribed = self . subscribed , unreviewed = self . unreviewed ) : <EOL> i = self . _projectRow ( i , project , None ) <EOL> for topic in session . getTopics ( ) : <EOL> i = self . _topicRow ( i , topic ) <EOL> topic_unreviewed = <NUM_LIT:0> <EOL> topic_open = <NUM_LIT:0> <EOL> for project in topic . projects : <EOL> cache = self . app . project_cache . get ( project ) <EOL> topic_unreviewed += cache [ '<STR_LIT>' ] <EOL> topic_open += cache [ '<STR_LIT>' ] <EOL> if self . subscribed : <EOL> if not project . subscribed : <EOL> continue <EOL> if self . unreviewed and not cache [ '<STR_LIT>' ] : <EOL> continue <EOL> if topic . key in self . open_topics : <EOL> i = self . _projectRow ( i , project , topic ) <EOL> topic_row = self . topic_rows . get ( topic . key ) <EOL> topic_row . update ( topic , topic_unreviewed , topic_open ) <EOL> while i < len ( self . listbox . body ) : <EOL> current_row = self . listbox . body [ i ] <EOL> self . _deleteRow ( current_row ) <EOL> def toggleSubscribed ( self , project_key ) : <EOL> with self . app . db . getSession ( ) as session : <EOL> project = session . getProject ( project_key ) <EOL> project . subscribed = not project . subscribed <EOL> ret = project . subscribed <EOL> return ret <EOL> def onSelect ( self , button , data ) : <EOL> project_key , project_name = data <EOL> self . app . changeScreen ( view_change_list . ChangeListView ( <EOL> self . app , <EOL> "<STR_LIT>" % ( project_key , self . app . config . project_change_list_query ) , <EOL> project_name , project_key = project_key , unreviewed = True ) ) <EOL> def onSelectTopic ( self , button , data ) : <EOL> topic_key = data [ <NUM_LIT:0> ] <EOL> self . open_topics ^= set ( [ topic_key ] ) <EOL> self . refresh ( ) <EOL> def toggleMark ( self ) : <EOL> if not len ( self . listbox . body ) : <EOL> return <EOL> pos = self . listbox . focus_position <EOL> row = self . listbox . body [ pos ] <EOL> row . toggleMark ( ) <EOL> self . advance ( ) <EOL> def createTopic ( self ) : <EOL> dialog = mywid . LineEditDialog ( self . app , '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' , '<STR_LIT>' , self . app . ring ) <EOL> urwid . connect_signal ( dialog , '<STR_LIT>' , <EOL> lambda button : self . closeCreateTopic ( dialog , True ) ) <EOL> urwid . connect_signal ( dialog , '<STR_LIT>' , <EOL> lambda button : self . closeCreateTopic ( dialog , False ) ) <EOL> self . app . popup ( dialog ) <EOL> def closeCreateTopic ( self , dialog , save ) : <EOL> if save : <EOL> last_topic_key = None <EOL> for row in self . listbox . body : <EOL> if isinstance ( row , TopicRow ) : <EOL> last_topic_key = row . topic_key <EOL> with self . app . db . getSession ( ) as session : <EOL> if last_topic_key : <EOL> last_topic = session . getTopic ( last_topic_key ) <EOL> seq = last_topic . sequence + <NUM_LIT:1> <EOL> else : <EOL> seq = <NUM_LIT:0> <EOL> t = session . createTopic ( dialog . entry . edit_text , seq ) <EOL> self . app . backScreen ( ) <EOL> def deleteTopic ( self ) : <EOL> rows = self . getSelectedRows ( TopicRow ) <EOL> if not rows : <EOL> return <EOL> with self . app . db . getSession ( ) as session : <EOL> for row in rows : <EOL> topic = session . getTopic ( row . topic_key ) <EOL> session . delete ( topic ) <EOL> self . refresh ( ) <EOL> def renameTopic ( self ) : <EOL> pos = self . listbox . focus_position <EOL> row = self . listbox . body [ pos ] <EOL> if not isinstance ( row , TopicRow ) : <EOL> return <EOL> with self . app . db . getSession ( ) as session : <EOL> topic = session . getTopic ( row . topic_key ) <EOL> name = topic . name <EOL> key = topic . key <EOL> dialog = mywid . LineEditDialog ( self . app , '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' , name , self . app . ring ) <EOL> urwid . connect_signal ( dialog , '<STR_LIT>' , <EOL> lambda button : self . closeRenameTopic ( dialog , True , key ) ) <EOL> urwid . connect_signal ( dialog , '<STR_LIT>' , <EOL> lambda button : self . closeRenameTopic ( dialog , False , key ) ) <EOL> self . app . popup ( dialog ) <EOL> def closeRenameTopic ( self , dialog , save , key ) : <EOL> if save : <EOL> with self . app . db . getSession ( ) as session : <EOL> topic = session . getTopic ( key ) <EOL> topic . name = dialog . entry . edit_text <EOL> self . app . backScreen ( ) <EOL> def getSelectedRows ( self , cls ) : <EOL> ret = [ ] <EOL> for row in self . listbox . body : <EOL> if isinstance ( row , cls ) and row . mark : <EOL> ret . append ( row ) <EOL> if ret : <EOL> return ret <EOL> pos = self . listbox . focus_position <EOL> row = self . listbox . body [ pos ] <EOL> if isinstance ( row , cls ) : <EOL> return [ row ] <EOL> return [ ] <EOL> def copyMoveToTopic ( self , move ) : <EOL> if move : <EOL> verb = '<STR_LIT>' <EOL> else : <EOL> verb = '<STR_LIT>' <EOL> rows = self . getSelectedRows ( ProjectRow ) <EOL> if not rows : <EOL> return <EOL> with self . app . db . getSession ( ) as session : <EOL> topics = [ ( t . key , t . name ) for t in session . getTopics ( ) ] <EOL> dialog = TopicSelectDialog ( '<STR_LIT>' % verb , topics ) <EOL> urwid . connect_signal ( dialog , '<STR_LIT>' , <EOL> lambda button : self . closeCopyMoveToTopic ( dialog , True , rows , move ) ) <EOL> urwid . connect_signal ( dialog , '<STR_LIT>' , <EOL> lambda button : self . closeCopyMoveToTopic ( dialog , False , rows , move ) ) <EOL> self . app . popup ( dialog ) <EOL> def closeCopyMoveToTopic ( self , dialog , save , rows , move ) : <EOL> error = None <EOL> if save : <EOL> with self . app . db . getSession ( ) as session : <EOL> key = dialog . getSelected ( ) <EOL> new_topic = session . getTopic ( key ) <EOL> if not new_topic : <EOL> error = "<STR_LIT>" % topic_name <EOL> else : <EOL> for row in rows : <EOL> project = session . getProject ( row . project_key ) <EOL> if move and row . topic_key : <EOL> old_topic = session . getTopic ( row . topic_key ) <EOL> self . log . debug ( "<STR_LIT>" % ( project , old_topic ) ) <EOL> old_topic . removeProject ( project ) <EOL> self . log . debug ( "<STR_LIT>" % ( project , new_topic ) ) <EOL> new_topic . addProject ( project ) <EOL> self . app . backScreen ( ) <EOL> if error : <EOL> self . app . error ( error ) <EOL> def moveToTopic ( self ) : <EOL> self . copyMoveToTopic ( True ) <EOL> def copyToTopic ( self ) : <EOL> self . copyMoveToTopic ( False ) <EOL> def removeFromTopic ( self ) : <EOL> rows = self . getSelectedRows ( ProjectRow ) <EOL> rows = [ r for r in rows if r . topic_key ] <EOL> if not rows : <EOL> return <EOL> with self . app . db . getSession ( ) as session : <EOL> for row in rows : <EOL> project = session . getProject ( row . project_key ) <EOL> topic = session . getTopic ( row . topic_key ) <EOL> self . log . debug ( "<STR_LIT>" % ( project , topic ) ) <EOL> topic . removeProject ( project ) <EOL> self . refresh ( ) <EOL> def toggleSubscribed ( self ) : <EOL> rows = self . getSelectedRows ( ProjectRow ) <EOL> if not rows : <EOL> return <EOL> keys = [ row . project_key for row in rows ] <EOL> subscribed_keys = [ ] <EOL> with self . app . db . getSession ( ) as session : <EOL> for key in keys : <EOL> project = session . getProject ( key ) <EOL> project . subscribed = not project . subscribed <EOL> if project . subscribed : <EOL> subscribed_keys . append ( key ) <EOL> for row in rows : <EOL> if row . mark : <EOL> row . toggleMark ( ) <EOL> for key in subscribed_keys : <EOL> self . app . sync . submitTask ( sync . SyncProjectTask ( key ) ) <EOL> self . refresh ( ) <EOL> def keypress ( self , size , key ) : <EOL> if not self . app . input_buffer : <EOL> key = super ( ProjectListView , self ) . keypress ( size , key ) <EOL> keys = self . app . input_buffer + [ key ] <EOL> commands = self . app . config . keymap . getCommands ( keys ) <EOL> ret = self . handleCommands ( commands ) <EOL> if ret is True : <EOL> if keymap . FURTHER_INPUT not in commands : <EOL> self . app . clearInputBuffer ( ) <EOL> return None <EOL> return key <EOL> def handleCommands ( self , commands ) : <EOL> if keymap . TOGGLE_LIST_REVIEWED in commands : <EOL> self . unreviewed = not self . unreviewed <EOL> self . refresh ( ) <EOL> return True <EOL> if keymap . TOGGLE_LIST_SUBSCRIBED in commands : <EOL> self . subscribed = not self . subscribed <EOL> self . refresh ( ) <EOL> return True <EOL> if keymap . TOGGLE_SUBSCRIBED in commands : <EOL> self . toggleSubscribed ( ) <EOL> return True <EOL> if keymap . TOGGLE_MARK in commands : <EOL> self . toggleMark ( ) <EOL> return True <EOL> if keymap . NEW_PROJECT_TOPIC in commands : <EOL> self . createTopic ( ) <EOL> return True <EOL> if keymap . DELETE_PROJECT_TOPIC in commands : <EOL> self . deleteTopic ( ) <EOL> return True <EOL> if keymap . COPY_PROJECT_TOPIC in commands : <EOL> self . copyToTopic ( ) <EOL> return True <EOL> if keymap . MOVE_PROJECT_TOPIC in commands : <EOL> self . moveToTopic ( ) <EOL> return True <EOL> if keymap . REMOVE_PROJECT_TOPIC in commands : <EOL> self . removeFromTopic ( ) <EOL> return True <EOL> if keymap . RENAME_PROJECT_TOPIC in commands : <EOL> self . renameTopic ( ) <EOL> return True <EOL> if keymap . REFRESH in commands : <EOL> self . app . sync . submitTask ( <EOL> sync . SyncSubscribedProjectsTask ( sync . HIGH_PRIORITY ) ) <EOL> self . app . status . update ( ) <EOL> self . refresh ( ) <EOL> return True <EOL> return False </s>
