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


Groups > comp.lang.python > #51351

Re: Cross-Platform Python3 Equivalent to notify-send

Path csiph.com!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <rosuav@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.007
X-Spam-Evidence '*H*': 0.99; '*S*': 0.00; 'anyway.': 0.05; 'dev': 0.07; 'collier': 0.09; 'option,': 0.09; 'screen.': 0.09; 'subject:Python3': 0.09; 'window.': 0.09; 'python': 0.11; 'gui': 0.12; 'windows': 0.15; 'archives,': 0.16; 'cloexec': 0.16; 'command.': 0.16; 'descriptors': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'highlight': 0.16; 'magic': 0.16; 'nightmare': 0.16; 'optionally': 0.16; 'subject:send': 0.16; 'view)': 0.16; 'workspace': 0.16; 'sat,': 0.16; 'wrote:': 0.18; 'discussion': 0.18; 'passing': 0.19; 'team,': 0.22; 'certainly': 0.24; 'fairly': 0.24; 'task': 0.26; 'least': 0.26; 'header:In- Reply-To:1': 0.27; 'point': 0.28; 'feature': 0.29; 'said,': 0.30; 'talented': 0.30; 'message-id:@mail.gmail.com': 0.30; 'that.': 0.31; 'usually': 0.31; 'disable': 0.31; 'trivial': 0.31; "user's": 0.31; 'file': 0.32; 'quite': 0.32; 'implemented': 0.33; 'core': 0.34; 'display': 0.35; 'something': 0.35; 'johnson': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'there': 0.35; 'really': 0.36; 'doing': 0.36; 'url:org': 0.36; 'should': 0.36; 'turn': 0.37; 'thank': 0.38; 'window': 0.38; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'little': 0.38; 'recent': 0.39; '(from': 0.39; 'though,': 0.39; 'to:addr:python.org': 0.39; 'enough': 0.39; 'called': 0.40; 'how': 0.40; 'managers': 0.61; 'simply': 0.61; "you'll": 0.62; 'capable': 0.67; 'flash': 0.69; 'user,': 0.69; 'jul': 0.74; 'hoping': 0.75; 'yourself': 0.78; 'moves': 0.84; 'python-dev': 0.84; 'subject:Platform': 0.84; 'browse': 0.95; 'mrs': 0.96; '2013': 0.98
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=4ydtLxjyWdfXXXzeuZ8svFIIAARflB7bT8cf192kq8A=; b=xrJQoc0tSt/zZM+KKXLmjbVN+jINO11u+5kr161LFRwGl931//akxI+x5rNamDYUgM bksnrERY0YU0VczjbY/aVPGyimAt8w2dyWC0k7gwwdkr9Lj0l87NgRaHaz39oZUhDeBH mUBxgNkYT1ZmdX3nVNULkRKfo3prUmq5sLntjwRQ6eBSpfGSUCsZHOCW7XYlqtr5Byjv lQdze9bNkbCBkNeag0aKokt8r0DmhSxrBxor5ZJzyt+f1E08kltu9/6VS+dqVUzVUj/Z N0dQzrd6uo1jN/A7+tyrD6sY/xAz10CRMqbjOBWZdc2lKgR6p9jfK/0kG+VTTsrMepB9 s5pg==
MIME-Version 1.0
X-Received by 10.58.187.4 with SMTP id fo4mr22777542vec.55.1374929267274; Sat, 27 Jul 2013 05:47:47 -0700 (PDT)
In-Reply-To <51F3BB68.2040307@Gmail.com>
References <51F3A7BB.4000305@Gmail.com> <CAMw+j7K2KXSvFCAg8pMaMeV2wiQDCJWtv4bb9hFsbfHcdX_U6A@mail.gmail.com> <51F3BB68.2040307@Gmail.com>
Date Sat, 27 Jul 2013 13:47:47 +0100
Subject Re: Cross-Platform Python3 Equivalent to notify-send
From Chris Angelico <rosuav@gmail.com>
To python-list@python.org
Content-Type text/plain; charset=ISO-8859-1
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://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 <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.5166.1374929275.3114.python-list@python.org> (permalink)
Lines 29
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1374929275 news.xs4all.nl 15879 [2001:888:2000:d::a6]:52044
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:51351

Show key headers only | View raw


On Sat, Jul 27, 2013 at 1:22 PM, Devyn Collier Johnson
<devyncjohnson@gmail.com> wrote:
> That really sucks. I was hoping Python had some way of doing that. All that
> it needs to do is display a little box at one of the corners of the screen.
> I thought someone would have implemented something by now. Thank you anyway.

Despite the best efforts of a pretty talented core dev team, Python is
not yet capable of magic :) If you browse the python-dev archives,
you'll see how much of a nightmare cross-platform compatibility can be
(eg the recent discussion on cloexec and passing file descriptors to
subprocesses); often, what you might think (from a user's point of
view) is fairly trivial will turn out to be quite tricky.

That said, though, a lot of GUI toolkits will have a means for you to
highlight a window. In GTK, it's called "present" (as in, "Lord User,
may I present Sir Window and Mrs Window?"). There may be window
managers that don't support the feature (and there are certainly those
that let the user disable it, which you should respect), but AFAIK all
of them should at least accept the command.

http://www.pygtk.org/docs/pygtk/class-gtkwindow.html#method-gtkwindow--present

So your best bet may be to simply create yourself a small window, then
present it. On Windows XP, I think that'll flash the window in the
task bar, which is usually enough highlight. On my Debian Wheezy with
Xfce, it brings the window to the top of the Z-order, and optionally
moves it to the current workspace (user's option, NOT program's).

ChrisA

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


Thread

Re: Cross-Platform Python3 Equivalent to notify-send Chris Angelico <rosuav@gmail.com> - 2013-07-27 13:47 +0100

csiph-web