<s> '''<STR_LIT>''' <EOL> from tkinter import * <EOL> try : <EOL> from tkinter . ttk import * <EOL> except ImportError : <EOL> from ttk import * <EOL> import os <EOL> from arelle import ( ViewWinTree , ModelDocument ) <EOL> def viewRssFeed ( modelXbrl , tabWin ) : <EOL> view = ViewRssFeed ( modelXbrl , tabWin ) <EOL> modelXbrl . modelManager . showStatus ( _ ( "<STR_LIT>" ) ) <EOL> view . treeView [ "<STR_LIT>" ] = ( "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT:status>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" ) <EOL> view . treeView . column ( "<STR_LIT>" , width = <NUM_LIT> , anchor = "<STR_LIT:w>" ) <EOL> view . treeView . heading ( "<STR_LIT>" , text = "<STR_LIT>" ) <EOL> view . treeView . column ( "<STR_LIT>" , width = <NUM_LIT:30> , anchor = "<STR_LIT:w>" ) <EOL> view . treeView . heading ( "<STR_LIT>" , text = "<STR_LIT>" ) <EOL> view . treeView . column ( "<STR_LIT>" , width = <NUM_LIT> , anchor = "<STR_LIT:w>" ) <EOL> view . treeView . heading ( "<STR_LIT>" , text = "<STR_LIT>" ) <EOL> view . treeView . column ( "<STR_LIT>" , width = <NUM_LIT> , anchor = "<STR_LIT:w>" ) <EOL> view . treeView . heading ( "<STR_LIT>" , text = "<STR_LIT>" ) <EOL> view . treeView . column ( "<STR_LIT:status>" , width = <NUM_LIT> , anchor = "<STR_LIT:w>" ) <EOL> view . treeView . heading ( "<STR_LIT:status>" , text = "<STR_LIT>" ) <EOL> view . treeView . column ( "<STR_LIT>" , width = <NUM_LIT> , anchor = "<STR_LIT:w>" ) <EOL> view . treeView . heading ( "<STR_LIT>" , text = "<STR_LIT>" ) <EOL> view . treeView . column ( "<STR_LIT>" , width = <NUM_LIT> , anchor = "<STR_LIT:w>" ) <EOL> view . treeView . heading ( "<STR_LIT>" , text = "<STR_LIT>" ) <EOL> view . treeView . column ( "<STR_LIT>" , width = <NUM_LIT:100> , anchor = "<STR_LIT:w>" ) <EOL> view . treeView . heading ( "<STR_LIT>" , text = "<STR_LIT>" ) <EOL> view . view ( ) <EOL> view . blockSelectEvent = <NUM_LIT:1> <EOL> view . blockViewModelObject = <NUM_LIT:0> <EOL> view . treeView . bind ( "<STR_LIT>" , view . treeviewSelect , '<STR_LIT:+>' ) <EOL> view . treeView . bind ( "<STR_LIT>" , view . treeviewEnter , '<STR_LIT:+>' ) <EOL> view . treeView . bind ( "<STR_LIT>" , view . treeviewLeave , '<STR_LIT:+>' ) <EOL> view . treeView . bind ( view . modelXbrl . modelManager . cntlr . contextMenuClick , view . setMenuHtmURLs , '<STR_LIT:+>' ) <EOL> cntxMenu = view . contextMenu ( ) <EOL> view . setMenuHtmURLs ( ) <EOL> rssWatchMenu = Menu ( view . viewFrame , tearoff = <NUM_LIT:0> ) <EOL> rssWatchMenu . add_command ( label = _ ( "<STR_LIT>" ) , underline = <NUM_LIT:0> , command = lambda : modelXbrl . modelManager . cntlr . rssWatchOptionsDialog ( ) ) <EOL> rssWatchMenu . add_command ( label = _ ( "<STR_LIT>" ) , underline = <NUM_LIT:0> , command = lambda : modelXbrl . modelManager . cntlr . rssWatchControl ( start = True ) ) <EOL> rssWatchMenu . add_command ( label = _ ( "<STR_LIT>" ) , underline = <NUM_LIT:0> , command = lambda : modelXbrl . modelManager . cntlr . rssWatchControl ( stop = True ) ) <EOL> cntxMenu . add_cascade ( label = _ ( "<STR_LIT>" ) , menu = rssWatchMenu , underline = <NUM_LIT:0> ) <EOL> view . menuAddClipboard ( ) <EOL> class ViewRssFeed ( ViewWinTree . ViewTree ) : <EOL> def __init__ ( self , modelXbrl , tabWin ) : <EOL> super ( ViewRssFeed , self ) . __init__ ( modelXbrl , tabWin , "<STR_LIT>" , True ) <EOL> def view ( self ) : <EOL> self . setColumnsSortable ( startUnsorted = True ) <EOL> self . clearTreeView ( ) <EOL> self . viewRssFeed ( self . modelXbrl . modelDocument , "<STR_LIT>" ) <EOL> def viewRssFeed ( self , modelDocument , parentNode ) : <EOL> self . id = <NUM_LIT:1> <EOL> for rssItem in modelDocument . rssItems : <EOL> node = self . treeView . insert ( parentNode , "<STR_LIT:end>" , rssItem . objectId ( ) , <EOL> text = ( rssItem . companyName or '<STR_LIT>' ) , <EOL> tags = ( "<STR_LIT>" if self . id & <NUM_LIT:1> else "<STR_LIT>" , ) ) <EOL> self . treeView . set ( node , "<STR_LIT>" , rssItem . formType ) <EOL> self . treeView . set ( node , "<STR_LIT>" , rssItem . filingDate ) <EOL> self . treeView . set ( node , "<STR_LIT>" , rssItem . cikNumber ) <EOL> self . treeView . set ( node , "<STR_LIT:status>" , rssItem . status ) <EOL> self . treeView . set ( node , "<STR_LIT>" , rssItem . period ) <EOL> self . treeView . set ( node , "<STR_LIT>" , rssItem . fiscalYearEnd ) <EOL> self . treeView . set ( node , "<STR_LIT>" , "<STR_LIT:U+0020>" . join ( str ( result ) for result in ( rssItem . results or [ ] ) ) + <EOL> ( ( "<STR_LIT:U+0020>" + str ( rssItem . assertions ) ) if rssItem . assertions else "<STR_LIT>" ) ) <EOL> self . id += <NUM_LIT:1> ; <EOL> else : <EOL> pass <EOL> def setMenuHtmURLs ( self , event = None ) : <EOL> import webbrowser <EOL> filingMenu = Menu ( self . viewFrame , tearoff = <NUM_LIT:0> ) <EOL> filingMenu . add_command ( label = _ ( "<STR_LIT>" ) , underline = <NUM_LIT:0> , command = self . openInstance ) <EOL> if event is not None : <EOL> self . menu . delete ( <NUM_LIT:0> , <NUM_LIT:0> ) <EOL> menuRow = self . treeView . identify_row ( event . y ) <EOL> modelRssItem = self . modelXbrl . modelObject ( menuRow ) <EOL> if modelRssItem is not None : <EOL> for description , url in modelRssItem . htmURLs : <EOL> filingMenu . add_command ( label = description , underline = <NUM_LIT:0> , <EOL> command = lambda u = url : webbrowser . open ( u ) ) <EOL> self . menu . insert_cascade ( <NUM_LIT:0> , label = _ ( "<STR_LIT>" ) , menu = filingMenu , underline = <NUM_LIT:0> ) <EOL> def openInstance ( self ) : <EOL> rssItemObj = self . modelXbrl . modelObject ( self . menuRow ) <EOL> if rssItemObj is not None : <EOL> self . modelXbrl . modelManager . cntlr . fileOpenFile ( rssItemObj . zippedUrl , selectTopView = True ) <EOL> def treeviewEnter ( self , * args ) : <EOL> self . blockSelectEvent = <NUM_LIT:0> <EOL> def treeviewLeave ( self , * args ) : <EOL> self . blockSelectEvent = <NUM_LIT:1> <EOL> def treeviewSelect ( self , * args ) : <EOL> if self . blockSelectEvent == <NUM_LIT:0> and self . blockViewModelObject == <NUM_LIT:0> : <EOL> self . blockViewModelObject += <NUM_LIT:1> <EOL> self . modelXbrl . viewModelObject ( self . treeView . selection ( ) [ <NUM_LIT:0> ] ) <EOL> self . blockViewModelObject -= <NUM_LIT:1> <EOL> def viewModelObject ( self , rssItem ) : <EOL> if self . blockViewModelObject == <NUM_LIT:0> : <EOL> self . blockViewModelObject += <NUM_LIT:1> <EOL> rssItemId = rssItem . objectId ( ) <EOL> if self . treeView . exists ( rssItemId ) : <EOL> self . treeView . set ( rssItemId , "<STR_LIT:status>" , rssItem . status ) <EOL> self . treeView . set ( rssItemId , "<STR_LIT>" , "<STR_LIT:U+0020>" . join ( str ( result ) for result in ( rssItem . results or [ ] ) ) + <EOL> ( ( "<STR_LIT:U+0020>" + str ( rssItem . assertions ) ) if rssItem . assertions else "<STR_LIT>" ) ) <EOL> self . treeView . see ( rssItemId ) <EOL> self . treeView . selection_set ( rssItemId ) <EOL> self . blockViewModelObject -= <NUM_LIT:1> </s>
