Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #100421

Re: Screenshots in Sphinx docs

Path csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail
From Terry Reedy <tjreedy@udel.edu>
Newsgroups comp.lang.python
Subject Re: Screenshots in Sphinx docs
Date Mon, 14 Dec 2015 14:01:03 -0500
Lines 38
Message-ID <mailman.16.1450119690.14916.python-list@python.org> (permalink)
References <DUB123-W31ED9418F2217DF68A041183ED0@phx.gbl>
Mime-Version 1.0
Content-Type text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding 7bit
X-Trace news.uni-berlin.de cHYq7jfg6S9vvttMQtV9YgKebIDWRJM+KAz4kuC/RO1Q==
Return-Path <python-python-list@m.gmane.org>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.000
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'url:pypi': 0.03; '(python': 0.05; '(of': 0.07; 'automate': 0.07; 'sphinx': 0.07; 'directive.': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'url:blog': 0.10; 'python': 0.10; 'jan': 0.11; 'output': 0.13; 'up-to-date': 0.13; 'appropriate': 0.14; '*any*': 0.16; 'build.': 0.16; 'operation.': 0.16; 'pypi.': 0.16; 'received:80.91.229.3': 0.16; 'received:io': 0.16; 'received:plane.gmane.org': 0.16; 'received:psf.io': 0.16; 'reedy': 0.16; 'screenshots': 0.16; 'wrote:': 0.16; 'app': 0.16; 'widget': 0.18; 'windows': 0.20; 'doc': 0.22; 'mind.': 0.22; 'tkinter': 0.22; 'am,': 0.23; 'appears': 0.23; 'header:In-Reply-To:1': 0.24; 'header:User- Agent:1': 0.26; 'header:X-Complaints-To:1': 0.26; 'possibility': 0.27; 'format,': 0.27; "skip:' 10": 0.28; 'looks': 0.29; "i'd": 0.31; 'probably': 0.31; 'screen': 0.32; 'getting': 0.33; 'url:python': 0.33; 'particular,': 0.33; 'something': 0.35; 'but': 0.36; 'needed': 0.36; 'there': 0.36; 'url:org': 0.36; 'received:71': 0.36; 'to:addr:python-list': 0.36; 'subject:: ': 0.37; 'display': 0.37; 'received:org': 0.37; 'thought': 0.37; 'application': 0.39; 'takes': 0.39; 'rather': 0.39; 'to:addr:python.org': 0.40; 'save': 0.60; 'url:%20': 0.63; 'programs,': 0.72; 'grabbing': 0.84; 'redirecting': 0.84; 'received:fios.verizon.net': 0.91
X-Injected-Via-Gmane http://gmane.org/
X-Gmane-NNTP-Posting-Host pool-71-185-227-36.phlapa.fios.verizon.net
User-Agent Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0
In-Reply-To <DUB123-W31ED9418F2217DF68A041183ED0@phx.gbl>
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.20+
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Xref csiph.com comp.lang.python:100421

Show key headers only | View raw


On 12/14/2015 11:31 AM, Albert-Jan Roskam wrote:

> I'd like to include up-to-date screenshots (of a tkinter app)
 > into my Sphinx documentation.

If you manually take screenshots with *any* screen grabber and save in 
an appropriate format, this is apparently trivial -- use the ..image 
directive.  From the below, it appears that what you want is to have a 
literally up-to-date screenshot taken automatically during the doc build.

This requires that one be able to automate getting the application into 
the exact display state one wants to capture.  You can probably do that 
with a tkinter app if you write it with that possibility in mind.  In 
particular, you must keep a Python reference to every widget you want to 
manipulate, even if not needed for normal program operation.

There is also an issue with grabbing the whole screen versus only a 
program-specific window.

 > This looks ok:
> https://pypi.python.org/pypi/sphinxcontrib-programscreenshot

This (automatically) takes 'screenshots' on a no-screen (headless) *nix 
system (during doc build) by redirecting X-windows output to a 
pseudo-screen program.  Rather clever, and system-specific.

> BUT I need something that works on Windows (Python 2.7).
 > Can any recommend an approach? I thought about using PIL:

Get the pillow fork/upgrade on pypi.

> http://www.varesano.net/blog/fabio/capturing%20screen%20image%20python%20and%20pil%20windows

Or look into Windows screen grabber programs, of which there are many.

-- 
Terry Jan Reedy

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: Screenshots in Sphinx docs Terry Reedy <tjreedy@udel.edu> - 2015-12-14 14:01 -0500

csiph-web