Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IDLE : Add clipboard history feature #64768

Closed
SaimadhavHeblikar mannequin opened this issue Feb 9, 2014 · 3 comments
Closed

IDLE : Add clipboard history feature #64768

SaimadhavHeblikar mannequin opened this issue Feb 9, 2014 · 3 comments
Labels
topic-IDLE type-feature A feature request or enhancement

Comments

@SaimadhavHeblikar
Copy link
Mannequin

SaimadhavHeblikar mannequin commented Feb 9, 2014

BPO 20569
Nosy @terryjreedy, @serhiy-storchaka
Files
  • python-clipboard-history-enhancement.patch: IDLE : Add clipboard history feature
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2014-02-16.03:29:16.854>
    created_at = <Date 2014-02-09.02:46:30.879>
    labels = ['expert-IDLE', 'type-feature']
    title = 'IDLE : Add clipboard history feature'
    updated_at = <Date 2014-10-11.21:47:12.782>
    user = 'https://bugs.python.org/SaimadhavHeblikar'

    bugs.python.org fields:

    activity = <Date 2014-10-11.21:47:12.782>
    actor = 'terry.reedy'
    assignee = 'none'
    closed = True
    closed_date = <Date 2014-02-16.03:29:16.854>
    closer = 'Saimadhav.Heblikar'
    components = ['IDLE']
    creation = <Date 2014-02-09.02:46:30.879>
    creator = 'Saimadhav.Heblikar'
    dependencies = []
    files = ['34002']
    hgrepos = []
    issue_num = 20569
    keywords = ['patch']
    message_count = 3.0
    messages = ['210714', '210727', '210777']
    nosy_count = 3.0
    nosy_names = ['terry.reedy', 'serhiy.storchaka', 'Saimadhav.Heblikar']
    pr_nums = []
    priority = 'normal'
    resolution = 'rejected'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue20569'
    versions = ['Python 3.4']

    @SaimadhavHeblikar
    Copy link
    Mannequin Author

    SaimadhavHeblikar mannequin commented Feb 9, 2014

    Hi,
    this patch adds clipboard history feature to idle.with this,we can retrieve any cut/copied text after the start of idle.
    it uses a list to store the messages called _clipboard_history
    it creates a dialog window to present a listbox and a paste button to the user.
    further ideas for this patch could include making the clipboard history accessible across files(which is not possible in this patch)

    @SaimadhavHeblikar SaimadhavHeblikar mannequin added topic-IDLE type-feature A feature request or enhancement labels Feb 9, 2014
    @terryjreedy
    Copy link
    Member

    Some issues that I think of off the top of my head, without looking into the details of the code.

    1. I am not sure how I would use this. I am thus not sure why I might push this, especially given that there are a hundred other Idle issues, many with patches that also need to be reviewed. Enlighten and persuade me. Also see 7.

    2. There are at least 4 styles of tkinter imports:
      a. import tkinter
      b. import tkinter as tk
      c. from tkinter import a,b,c
      d. from tkinter import *

    My personal preference is b, c, (a,d). I have never done a census of idlelib modules to see what is currently used. While tkinter was designed somewhat to allow d, 'from *' in general has lost favor since
    Idle was written to in favor of b. That change was made in the tkinter docs, for instance
    http://docs.python.org/3/library/tkinter.html#a-simple-hello-world-program
    a few years ago. So I would like to use 'as tk' for new code.

    1. idlever is useless and should probably be removed after checking for any current uses. The import here is not used and should be removed.

    2. Writing tests for old code is slow and somewhat tedious. A new module should come with a test module in idle_test/. It might be named test_clipboard.py (see 6.) Check the README and existing files for what I might be looking for.

    3. The purpose of the if __name__: block is not clear. If it is simply a sanity check, this should be in the test file, guarded by 'requires(gui)'. The 'if __name__' block should run that file.

    4. I dislike the existing and obsolete practice of camel-case module names that duplicate class names. They also violate PEP-8. Uppercase module names outside of idlelib were changed in 3.0. I would like to change the existing names within idlelib also.

    5. The practice of putting each class in a separate file is not standard, neither in the stdlib nor in the community at large. This file is under 50 lines, which is pretty small. Some possibilities of where to put this class are the editor file, an new editor helper class file, or a clipboard file. Are there other clipboard classes or functions that could be moved into a consolidated clipboard.py? existing file where this class might

    6. As you indicate, this seems more like a proof of concept than a finished design. Let us consider features of the recent files list.

    a. The recent files list is not tied to a particular Idle version, let alone a particular window in a particular session of a particular version. I use the save-across sessions and versions features constantly. Most uses I can think of for a clipboard history would involve multiple windows, and possible multiple Idle sessions. An example would be boilerplate 'if __name__'. Perhaps I am more interested in a persistent snippets list with a easy way to copy an entire item (ie, click anywhere on an item and have that copy the entire item to the clipboard to be pasted whereever).

    b. The recent files list contains short pointers to possible large files on disk. The clipboard contents are not limited in size. I might not want 10 megabytes kept and saved to disk, so there should be a way to delete entries. Or perhaps entries should be added explicitly rather than automatically.

    c. The recent files list is limited to 20 entries -- the 20 most recently opened. (This should be user-configurable.) Entries that are dropped off can be found through the normal open process. Entries that are dropped off a snippet list are gone. So perhaps they should not disappear without warning.

    d. Entries in the recent files list fit on one line. That would not be true for snippets. Perhaps a snippets window should use a tree widget so items could be condensed to a single line (the first, or a title) or expanded to the full snippet.

    1. In some respects it would be good if this were implemented as an extension that could be enabled or not. See bpo-3068 for improving the selection and configuration of extensions.

    2. Little features for Idle can be applied to all versions current at the time of application. See PEP-434 for Idle does not follow the normal rule. But don't worry about the version header.

    • (I prefer not to read patches in detail until the author is recorded as having signed the CLA.)

    @serhiy-storchaka
    Copy link
    Member

    Clipboard history is OS feature, an application shouldn't duplicate it. Every modern Linux DE has builtin clipboard history manager, and I believe there are third-party programs for Windows.

    @SaimadhavHeblikar SaimadhavHeblikar mannequin closed this as completed Feb 16, 2014
    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    topic-IDLE type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants