コード例 #1
0
ファイル: contextWin.py プロジェクト: Stendec-UA/BEE2.4
 def show_more_info():
     url = selected_item.url
     if url is not None:
         try:
             webbrowser.open(url, new=OPEN_IN_TAB, autoraise=True)
         except webbrowser.Error:
             if messagebox.askyesno(
                     icon="error",
                     title="BEE2 - Error",
                     message='Failed to open a web browser. Do you wish for '
                     'the URL to be copied to the clipboard '
                     'instead?',
                     detail='"{!s}"'.format(url),
                     parent=prop_window):
                 print("Saving " + url + "to clipboard!")
                 TK_ROOT.clipboard_clear()
                 TK_ROOT.clipboard_append(url)
         # Either the webbrowser or the messagebox could cause the
         # properties to move behind the main window, so hide it
         # so it doesn't appear there.
         hide_context(None)
コード例 #2
0
ファイル: contextWin.py プロジェクト: Stendec-UA/BEE2.4
 def show_more_info():
     url = selected_item.url
     if url is not None:
         try:
             webbrowser.open(url, new=OPEN_IN_TAB, autoraise=True)
         except webbrowser.Error:
             if messagebox.askyesno(
                     icon="error",
                     title="BEE2 - Error",
                     message='Failed to open a web browser. Do you wish for '
                             'the URL to be copied to the clipboard '
                             'instead?',
                     detail='"{!s}"'.format(url),
                     parent=prop_window
                     ):
                 print("Saving " + url + "to clipboard!")
                 TK_ROOT.clipboard_clear()
                 TK_ROOT.clipboard_append(url)
         # Either the webbrowser or the messagebox could cause the
         # properties to move behind the main window, so hide it
         # so it doesn't appear there.
         hide_context(None)