original_docstring: Yank an element to the clipboard or primary selection.
docstring: Yank an element to the clipboard or primary selection.
docstring_tokens: Yank an element to the clipboard or primary selection .
code: def yank(self, url: QUrl, context: HintContext) -> None:
          """Yank an element to the clipboard or primary selection."""
          sel = (context.target == Target.yank_primary and
                 utils.supports_selection())
  
          flags = QUrl.FullyEncoded | QUrl.RemovePassword
          if url.scheme() == 'mailto':
              flags |= QUrl.RemoveScheme
          urlstr = url.toString(flags)  # type: ignore[arg-type]
  
          new_content = urlstr
  
          # only second and consecutive yanks are to append to the clipboard
          if context.rapid and not context.first_run:
              try:
                  old_content = utils.get_clipboard(selection=sel)
              except utils.ClipboardEmptyError:
                  pass
              else:
                  new_content = os.linesep.join([old_content, new_content])
          utils.set_clipboard(new_content, selection=sel)
  
          msg = "Yanked URL to {}: {}".format(
              "primary selection" if sel else "clipboard",
              urlstr)
          message.info(msg, replace='rapid-hints' if context.rapid else None)
code_tokens: def yank ( self , url : QUrl , context : HintContext ) -> None : sel = ( context . target == Target . yank_primary and utils . supports_selection ( ) ) flags = QUrl . FullyEncoded | QUrl . RemovePassword if url . scheme ( ) == 'mailto' : flags |= QUrl . RemoveScheme urlstr = url . toString ( flags ) new_content = urlstr if context . rapid and not context . first_run : try : old_content = utils . get_clipboard ( selection = sel ) except utils . ClipboardEmptyError : pass else : new_content = os . linesep . join ( [ old_content , new_content ] ) utils . set_clipboard ( new_content , selection = sel ) msg = "Yanked URL to {}: {}" . format ( "primary selection" if sel else "clipboard" , urlstr ) message . info ( msg , replace = 'rapid-hints' if context . rapid else None )
short_docstring: Yank an element to the clipboard or primary selection.
short_docstring_tokens: Yank an element to the clipboard or primary selection .
comment: """Yank an element to the clipboard or primary selection."""$SEP$# type: ignore[arg-type]$SEP$# only second and consecutive yanks are to append to the clipboard