[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Gnumed-bugs] trying to print Latex report from Git head (Mac 10.6.8
From: |
Karsten Hilbert |
Subject: |
Re: [Gnumed-bugs] trying to print Latex report from Git head (Mac 10.6.8) |
Date: |
Thu, 18 Aug 2011 11:58:15 +0200 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
On Tue, Aug 16, 2011 at 05:58:10PM -0700, Jim Busser wrote:
> > In particular, did the Mac App "Preview" show the document ?
>
> Yes, my Mac did open its PDF viewer app Preview in spite of the log complaint
> that it could not be found.
>
>
> > If so, does it still do so if you remove the
> > ../external-tools/gm-print_doc ?
>
> It is prevented from doing so if I rename gm-print_doc … this situation
> results in a gnumed GUI dialog
>
>
> Error printing document (generic document).
>
> Please consult the error log for all the gory details.
OK, good. What this tells us is this:
Calling
open -a Preview ${FILES}
from within a shell script (gm-print_doc) works just fine
(you saw Preview) while doing the same from within
gmPrinting.py:
for filename in filenames:
cmd_line = [
r'open', # "open" must
be in the PATH
r'-a Preview', # action = Preview
filename
]
_log.debug('printing with %s' % cmd_line)
try:
mac_preview = subprocess.Popen(cmd_line)
except OSError:
_log.debug('cannot run <open -a Preview>')
return False
mac_preview.communicate()
if mac_preview.returncode != 0:
_log.error('<open -a Preview> returned [%s], failed to
print', mac_preview.returncode)
return False
return True
does not (as documented in the GNUmed log).
I am modifying gmPrinting.py so you can run it on your Mac like so:
cd gnumed/client/pycommon
python gmPrinting.py test
and give us the results thereof.
It would also be helpful to check the Mac OSX documentation
for "open" and/or "Preview" to find out what the exit code 1
is supposed to mean - perhaps it is entirely correct that
this returns 1 rather than 0 ?
Can you modify gm-print_doc to read:
# Darwin/MacOSX ?
if [ "${CALL_PRINTER_MANAGER}" = "" ]; then
SYSTEM=`uname -s`
if [ ${SYSTEM} = "Darwin" ]; then
CALL_PRINTER_MANAGER="open -a Preview ${FILES}"
echo "exit code: $?"
#CALL_PRINTER_MANAGER="open ${FILES}"
fi
fi
at the appropriate place. Then please call it like so:
cd gnumed/external-tools/
./gm-print_doc some-existing-file.pdf
and tell us what's printed for exit code.
Karsten
--
GPG key ID E4071346 @ gpg-keyserver.de
E167 67FD A291 2BEA 73BD 4537 78B9 A9F9 E407 1346