<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def copy_to_clipboard(self, url):
 """ Attempt to copy the selected URL to the user's clipboard """

        if url is None:
            self.term.flash()
            return

        try:
            clipboard_copy(url)
        except (ProgramError, OSError) as e:
            _logger.exception(e)
            self.term.show_notification(
                'Failed to copy url: {0}'.format(e))
        else:
            self.term.show_notification(
                ['Copied to clipboard:', url], timeout=1)