# Is it possible to get the "Clipboard - Gramps" entities list?

**URL:** <https://gramps.discourse.group/t/is-it-possible-to-get-the-clipboard-gramps-entities-list/6399>\
**Category:** Development\
**Created:** [November 7, 2024, 6:46pm UTC](https://gramps.discourse.group/t/is-it-possible-to-get-the-clipboard-gramps-entities-list/6399 "2024-11-07T18:46:14Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Urchello](https://avatars.discourse-cdn.com/v4/letter/u/c4cdca/32.png) [@Urchello](https://gramps.discourse.group/u/Urchello)\
**Post date:** [November 7, 2024, 6:46pm UTC](https://gramps.discourse.group/t/is-it-possible-to-get-the-clipboard-gramps-entities-list/6399/1 "2024-11-07T18:46:14Z")

</div>

I would like to get the “Clipboard - Gramps” entities list from Gramps code (EditPerson class). Is it possible to implement this? Thanks

---

<div class="post-metadata">

**Author:** ![Nick-Hall](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/nick-hall/32/95_2.png) [@Nick-Hall](https://gramps.discourse.group/u/Nick-Hall)\
**Post date:** [November 7, 2024, 7:35pm UTC](https://gramps.discourse.group/t/is-it-possible-to-get-the-clipboard-gramps-entities-list/6399/2 "2024-11-07T19:35:58Z")

</div>

The [ClipboardWindow](https://github.com/gramps-project/gramps/blob/master/gramps/gui/clipboard.py#L1342) class has an attribute `otree` which is a [ClipboardListModel](https://github.com/gramps-project/gramps/blob/master/gramps/gui/clipboard.py#L876). This stores the list of objects held in the clipboard.

---

<div class="post-metadata">

**Author:** ![emyoulation](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/emyoulation/32/67_2.png) [@emyoulation](https://gramps.discourse.group/u/emyoulation)\
**Post date:** [November 7, 2024, 10:36pm UTC](https://gramps.discourse.group/t/is-it-possible-to-get-the-clipboard-gramps-entities-list/6399/3 "2024-11-07T22:36:21Z")

</div>

> [@Nick-Hall](#):
>
> The [ClipboardWindow](https://github.com/gramps-project/gramps/blob/master/gramps/gui/clipboard.py#L1342) class has an attribute `otree` which is a [ClipboardListModel](https://github.com/gramps-project/gramps/blob/master/gramps/gui/clipboard.py#L876). This stores the list of objects held in the clipboard

The Sphinx docs does not find this information.

- [searching for “clipboard”](https://gramps-project.org/docs/search.html?q=clipboard)
- [search for “Class”](https://gramps-project.org/docs/search.html?q=class)

How can information be be added to the Sphinx docs?

---

<div class="post-metadata">

**Author:** ![Nick-Hall](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/nick-hall/32/95_2.png) [@Nick-Hall](https://gramps.discourse.group/u/Nick-Hall)\
**Post date:** [November 7, 2024, 10:56pm UTC](https://gramps.discourse.group/t/is-it-possible-to-get-the-clipboard-gramps-entities-list/6399/4 "2024-11-07T22:56:51Z")

</div>

> [@emyoulation](#):
>
> How can information be be added to the Sphinx docs?

In this case, you would need to make sure that the classes are correctly annotated in their docstrings. Then add a section to the [docs/coregui/gui.rst](https://github.com/gramps-project/gramps/blob/master/docs/coregui/gui.rst) file.

---

<div class="post-metadata">

**Author:** ![emyoulation](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/emyoulation/32/67_2.png) [@emyoulation](https://gramps.discourse.group/u/emyoulation)\
**Post date:** [November 7, 2024, 11:26pm UTC](https://gramps.discourse.group/t/is-it-possible-to-get-the-clipboard-gramps-entities-list/6399/5 "2024-11-07T23:26:05Z")

</div>

> Asked Perplexity to collate (with citations) the wiki docs about modifying Gramps source for Sphinx

To effectively document Python source code for inclusion in the Gramps developer documentation managed by Sphinx, developers should adhere to specific guidelines and practices. Here’s a summarized overview based on the relevant sources:

### Key Guidelines for Documenting Python Source Code in Gramps

1. **Docstrings** :

2. **Sphinx Configuration** :

3. **Editing API Generating Files** :

4. **Coding Standards** :

5. **Class Headers** :

6. **Best Practices** :

7. **Contribution Guidelines** :

### Sources

- [Programming Guidelines](https://www.gramps-project.org/wiki/index.php/Programming_guidelines)
- [Documenting Python Code](https://realpython.com/documenting-python-code/)
- [Sphinx Documentation](https://docs.python.org/es/3/library/pydoc.html)

By following these guidelines, developers can ensure that their contributions are well-documented and easily integrated into the Gramps project’s Sphinx-managed documentation.

Citations:  
[1] [pydoc — Documentation generator and online help system — documentación de Python - 3.14.0](https://docs.python.org/es/3/library/pydoc.html)  
[2] [Documenting Python Code: A Complete Guide – Real Python](https://realpython.com/documenting-python-code/)  
[3] [Documenting Python Code and Projects | TestDriven.io](https://testdriven.io/blog/documenting-python/)  
[4] [Programming guidelines - Gramps](https://www.gramps-project.org/wiki/index.php/Programming_guidelines)  
[5] [https://www.datacamp.com/tutorial/documenting-python-code](https://www.datacamp.com/tutorial/documenting-python-code)  
[6] [Documentation in Python: Methods and Best Practices - Swimm](https://swimm.io/learn/code-documentation/documentation-in-python-methods-and-best-practices)  
[7] [Documentation — The Hitchhiker's Guide to Python](https://docs.python-guide.org/writing/documentation/)  
[8] [python - Documenting and detailing a single script based on the comments inside - Stack Overflow](https://stackoverflow.com/questions/62876777/documenting-and-detailing-a-single-script-based-on-the-comments-inside)

[1] [Using database API - Gramps](https://www.gramps-project.org/wiki/index.php/Using_database_API)  
[2] [Getting started with Gramps development - Gramps](https://www.gramps-project.org/wiki/index.php/Getting_started_with_Gramps_development)  
[3] [Documentation - Gramps](https://www.gramps-project.org/wiki/index.php/Documentation)  
[4] [isotammi-addons/source/SuperTool/README.md at master · Taapeli/isotammi-addons · GitHub](https://github.com/Taapeli/isotammi-addons/blob/master/source/SuperTool/README.md)  
[6] [Addon:Isotammi addons - Gramps](https://gramps-project.org/wiki/index.php/Addon:Isotammi_addons)  
[7] [GitHub - gramps-project/gramps-web-api: A RESTful web API for Gramps - backend of Gramps Web](https://github.com/gramps-project/gramps-web-api)  
[8] [Using Supertool to import Attributes and URLs - An example](https://gramps.discourse.group/t/using-supertool-to-import-attributes-and-urls-an-example/2094)

---

<div class="post-metadata">

**Author:** ![Nick-Hall](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/nick-hall/32/95_2.png) [@Nick-Hall](https://gramps.discourse.group/u/Nick-Hall)\
**Post date:** [November 7, 2024, 11:35pm UTC](https://gramps.discourse.group/t/is-it-possible-to-get-the-clipboard-gramps-entities-list/6399/6 "2024-11-07T23:35:11Z")

</div>

The [Sphinx reStructuredText Primer](https://www.sphinx-doc.org/en/master/usage/restructuredtext/basics.html) is a good reference.

---

<div class="post-metadata">

**Author:** ![emyoulation](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/emyoulation/32/67_2.png) [@emyoulation](https://gramps.discourse.group/u/emyoulation)\
**Post date:** [November 7, 2024, 11:48pm UTC](https://gramps.discourse.group/t/is-it-possible-to-get-the-clipboard-gramps-entities-list/6399/7 "2024-11-07T23:48:46Z")

</div>

Do you think that it is a viable idea to use SuperTool scripts to populate the [Useful Snippets](https://gramps-project.org/docs/api.html#useful-snippets) in the Sphinx API docs?

@kku has been wanting a way to organize the [example scripts](https://gramps-project.org/wiki/index.php/Addon:Isotammi_addons#SuperTool_Scripts). And SuperTools scripts would give fully functional stand-alone sample code. (Although we would have to complete the docs on evolving a proof-of-concept in SuperTool and wrapping a GUI around it as an addon… Gramplet, Tool, Report, Quick Report.)

I was thinking that a good way to answer the “polling the Clipboard” inquiry from @Urchello would be with a SuperTool script in the Dashboard.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/gramps/original/1X/2ac1e712b7adf612e31ca08a55419f4cf37c0158.png) [@system](https://gramps.discourse.group/u/system)\
**Post date:** [December 7, 2024, 11:49pm UTC](https://gramps.discourse.group/t/is-it-possible-to-get-the-clipboard-gramps-entities-list/6399/8 "2024-12-07T23:49:22Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
