emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nick Dokos <nicholas.dokos@hp.com>
To: =?utf-8?Q?Fran=C3=A7ois?= Pinard <pinard@iro.umontreal.ca>
Cc: nicholas.dokos@hp.com, emacs-orgmode@gnu.org
Subject: Re: A bit more feedback on org-publish-all
Date: Mon, 06 Feb 2012 10:27:53 -0500	[thread overview]
Message-ID: <24223.1328542073@alphaville> (raw)
In-Reply-To: Message from pinard@iro.umontreal.ca (=?utf-8?Q?Fran=C3=A7ois?= Pinard) of "Mon\, 06 Feb 2012 09\:56\:03 EST." <87ipjkau4c.fsf@iro.umontreal.ca>

François Pinard <pinard@iro.umontreal.ca> wrote:

> ... 
> This is more similar to my actual usage, which really is:
> 
>         [...]
>         write = sys.stderr.write
>         for line in os.popen('emacs 2>&1 -batch'
>                              ' -l ~/fp/notes/publish.el'
>                              ' -f org-publish-all'):
>             write(repr(line) + '\n')
>             sys.stderr.flush()
>             [...]
> 
> The write(...) and the flush() are only there for debugging: I wanted to
> see if the lines are delivered timely or not (and I'm seemingly getting
> the Emacs output in one blow).  I just do not understand why the
> behavior differs between the "... | cat" line and the Python excerpt.
> I'm surely missing something somewhere...  Sigh!
> 

I would recommend that you chuck the obsolete os.popen() permanently and
learn the subprocess module: you will be much happier. Setting bufsize=0
(which is the default) should give you unbuffered output from the process.

Nick

      parent reply	other threads:[~2012-02-06 15:28 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-05 14:48 A bit more feedback on org-publish-all François Pinard
2012-02-06  1:31 ` François Pinard
2012-02-06  3:38   ` Nick Dokos
2012-02-06 14:56     ` François Pinard
2012-02-06 15:21       ` Nick Dokos
2012-02-06 15:27       ` Nick Dokos [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=24223.1328542073@alphaville \
    --to=nicholas.dokos@hp.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=pinard@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).