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


Groups > comp.lang.python > #38333

Re: Monitoring updating directory for image for GUI

Path csiph.com!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!border1.nntp.ams2.giganews.com!border2.nntp.ams2.giganews.com!border4.nntp.ams.giganews.com!border2.nntp.ams.giganews.com!nntp.giganews.com!feeder1.cambriumusenet.nl!82.197.223.103.MISMATCH!feeder3.cambriumusenet.nl!feed.tweaknews.nl!194.109.133.86.MISMATCH!newsfeed.xs4all.nl!newsfeed3.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.032
X-Spam-Evidence '*H*': 0.94; '*S*': 0.00; 'needed,': 0.05; 'command.': 0.09; 'created,': 0.09; 'overwrite': 0.09; 'gui': 0.11; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'naming': 0.16; 'png': 0.16; 'sequential': 0.16; 'subject:GUI': 0.16; 'subject:image': 0.16; 'wrote:': 0.17; 'basically': 0.17; 'thu,': 0.17; 'appears': 0.18; 'feb': 0.19; 'file.': 0.20; 'bit': 0.21; 'displayed': 0.22; 'header:In-Reply-To:1': 0.25; 'creating': 0.26; 'am,': 0.27; 'older': 0.27; 'question': 0.27; 'newer': 0.27; 'message-id:@mail.gmail.com': 0.27; 'this?': 0.28; 'run': 0.28; 'music.': 0.29; 'surprised': 0.29; 'this.': 0.29; "i'm": 0.29; 'usually': 0.30; 'notes': 0.30; 'file': 0.32; 'real-time': 0.33; 'problem': 0.33; 'to:addr:python-list': 0.33; 'monitor': 0.33; 'received:google.com': 0.34; 'doing': 0.35; 'sometimes': 0.35; 'received:209.85': 0.35; 'created': 0.36; 'but': 0.36; 'being': 0.37; 'received:209': 0.37; 'subject:: ': 0.38; 'files': 0.38; 'sure': 0.38; 'shows': 0.38; 'to:addr:python.org': 0.39; 'takes': 0.39; 'called': 0.39; 'where': 0.40; 'your': 0.60; 'skip:u 10': 0.60; 'most': 0.61; 'side': 0.61; 'latest': 0.61; 'leaving': 0.62; 'more': 0.63; 'show': 0.63; 'music': 0.79; '2013': 0.84; '9:02': 0.84; 'musical': 0.84; 'spawned': 0.84; 'sheet': 0.93; 'have.': 0.95
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:content-type:content-transfer-encoding; bh=WGHzIn8LhwSWYfGQ7S5ZG4XIrj3K//sAZh87w3ASK1o=; b=hyjBUwk93TH4h2zVnqcfBQdreU4mht76eYjufBgj8kBIisXfi3L1vdryxhr/rpEdYd uD9PjLWSW4Vnm73MT5KbPFnv4gEGhX6yNYXVIHvUihLdKBRDvxFRwXD726//5y9NGrvr XRkR72DzXObk5RHBXTOX+B+pLblAAcf54RB2pbpFGEJl4EHaDf79nNJF+tyjETH3IpGz IU5WKdgYoDmBTdeZApwMVsf37HzNjy2fqCMhfXuCtaMSdxHRyuEb7gwrhGe1AMQLtAnR eADSuyfKtAM51GQkbBtzGKNjOEFrxJg/HT2WTngSXXzutmkDjTaZA0zCBzfll3tZxZ5h E53w==
MIME-Version 1.0
X-Received by 10.220.156.10 with SMTP id u10mr207590vcw.28.1360218331319; Wed, 06 Feb 2013 22:25:31 -0800 (PST)
In-Reply-To <8a572770-9cc1-4b65-9053-10fd6c2f543b@googlegroups.com>
References <8a572770-9cc1-4b65-9053-10fd6c2f543b@googlegroups.com>
Date Thu, 7 Feb 2013 17:25:31 +1100
Subject Re: Monitoring updating directory for image for GUI
From Chris Angelico <rosuav@gmail.com>
To python-list@python.org
Content-Type text/plain; charset=ISO-8859-1
Content-Transfer-Encoding quoted-printable
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.1440.1360218333.2939.python-list@python.org> (permalink)
Lines 40
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1360218333 news.xs4all.nl 6882 [2001:888:2000:d::a6]:59397
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:38333

Show key headers only | View raw


On Thu, Feb 7, 2013 at 9:02 AM,  <ciscorucinski@gmail.com> wrote:
> Basically I am creating a program that will stream musical notes into a program called Lilypond one-by-one and it will create the sheet music for that stream of music via OS command. Your understanding of Lilypond is not needed, but you need to know that for each new note that is streamed in "real-time", a PNG image file will be created for that stream of music up to that point...via Lilypond.

I'm surprised nobody has yet responded to this. The list's usually a
lot quicker, heh...

Side point: How real-time can you actually run Lilypond? It usually
takes a bit of time to render a sheet of music. But leaving that
aside.

> What I am looking at doing is to monitor the directory where the image files are being created in real-time, and update the GUI (build with gtk.Builder and Glade) with the most recent image file. I have the program multithreaded and it appears that all of the images are being created sequentially; however, I need to make sure that an older image (an image with less notes displayed) is NOT going to be displayed over a newer image.
>
> The question I have is what do you see as the best way of going about this?

Not sure I fully understand the problem here. Tell me if this workflow
is correct:

* Note comes in
* Lilypond is spawned asynchronously to render the new state
* A new file is created, with a unique name
* Your program shows the latest of these files, no more and no less

Or do you need to sometimes show multiple files?

Can you make use of sequential file naming to ensure that you can
always find the latest file? That way, you just make sure you never
overwrite a displayed image whose name is > than the one you now have.

ChrisA

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


Thread

Monitoring updating directory for image for GUI ciscorucinski@gmail.com - 2013-02-06 14:02 -0800
  Re: Monitoring updating directory for image for GUI Chris Angelico <rosuav@gmail.com> - 2013-02-07 17:25 +1100
    Re: Monitoring updating directory for image for GUI ciscorucinski@gmail.com - 2013-02-07 16:48 -0800
      Re: Monitoring updating directory for image for GUI Oscar Benjamin <oscar.j.benjamin@gmail.com> - 2013-02-08 02:01 +0000
        Re: Monitoring updating directory for image for GUI ciscorucinski@gmail.com - 2013-02-08 09:09 -0800
          Re: Monitoring updating directory for image for GUI Oscar Benjamin <oscar.j.benjamin@gmail.com> - 2013-02-09 00:53 +0000
          Re: Monitoring updating directory for image for GUI Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2013-02-08 20:32 -0500
        Re: Monitoring updating directory for image for GUI ciscorucinski@gmail.com - 2013-02-08 09:09 -0800
    Re: Monitoring updating directory for image for GUI ciscorucinski@gmail.com - 2013-02-07 16:48 -0800
  Re: Monitoring updating directory for image for GUI Alain Ketterlin <alain@dpt-info.u-strasbg.fr> - 2013-02-07 11:25 +0100
  Re: Monitoring updating directory for image for GUI Piet van Oostrum <piet@vanoostrum.org> - 2013-02-07 18:11 +0100
  Re: Monitoring updating directory for image for GUI ciscorucinski@gmail.com - 2013-02-11 14:50 -0800
    Re: Monitoring updating directory for image for GUI MRAB <python@mrabarnett.plus.com> - 2013-02-11 23:50 +0000
    Re: Monitoring updating directory for image for GUI Piet van Oostrum <piet@vanoostrum.org> - 2013-02-13 17:09 +0100

csiph-web