Happens with the present code as well. I'll investigate soon.
Edward
Fixed on the trunk at rev 4720. I had forgotten I was responsible
(2005) for the initial port of Engelbert Gruber's code for the rst3
plugin, presumably because I didn't spend much time on it. Six years
from now I may well have forgotten all about today's work...
I tested the code using Python 2.6, because that was all that was
available from the open source download page of reportlab:
http://www.reportlab.com/ftp/ As noted below, I copied code from
stylesheet.py, obtained from: #
http://docutils.sourceforge.net/sandbox/dreamcatcher/rlpdf/
Please read the checkin log in the Post Script carefully. There is
not now, nor has there ever been, a great deal of support for the
module. If you want enhancements you would be well advised to develop
them yourself.
Edward
P.S. Here is the checkin log:
QQQQQ
Updated leoRst code to handle revised leo_pdf.py module. Trivial test
passes, but there are no promises.
Here is the updated version history from leopdf.py:
1.0 EKR 2011/11/03:
- Various changes to come accomodate docutils changes.
- Added dummy Reporter class for use by get_language.
- I suspect this should be logger class, but I don't much care.
- Incorporate getStyleSheet from stylesheet.py, obtained from:
http://docutils.sourceforge.net/sandbox/dreamcatcher/rlpdf/
Note: passing writer_name = leo.plugins.leo_pdf to docutils does not work,
presumably because __import__('leo.plugins.leo_pdf') returns the *leo* module,
and docutils seems not to be aware of this fact.
As a workaround, the new rst3 code passes writer = Writer() (an
instance) instead.
QQQQQ
EKR
> docutils.languages.get_language(doctree.settings.language_code,self.reporter)
> TypeError: get_language() takes exactly 1 argument (2 given)
Well, this is interesting. get_language takes 2 arguments in the
version of docutils I am using. I suppose the code is going to have
to try it both ways.
This is a docutils screw-up: imo the new api should have been upward
compatible with the old. It would have been easy to do: just make the
new second argument optional.
Oh well...I'll fix this soon.
Edward
> get_language takes 2 arguments in the version of docutils I am using. I suppose the code is going to have to try it both ways...I'll fix this soon.
Done at rev 4744. The previous unit tests still passes, but of course
that doesn't mean much. Please let me know how the code works for
you.
Edward
Thanks for this report. I'll fix this today, and (presumably) add a unit test.
It may take a few more iterations before things settle down
completely, due to differing environments, but we'll get the job done
eventually.
Edward
I'm not sure it would be wise to attempt a fix in leo_pdf.leo.
The code works with reportlab-daily.win32-py2.6.exe. What version of
reportlab are you using? What happens when you upgrade to a recent
version?
Edward
> Sorry, but trying anything newer will have to wait - no time at the
> moment.
No rush. leo_pdf probably works as well now as it ever has. Not sure
how many people actually use it.
EKR
Thanks for your vote. I'm leaning the same way. I think using
standard tools wherever possible is a big improvements over hacks like
leo_pdf.py.
> This looks similar to using latexpdf
> and the option to convert rst to latex as
> another step remains possible
> (to leverage latex's abilities)
That option is always possible, regardless of whether leo_pdf.py exists or not.
Edward
I second this vote also. My toolchain previously include converting leo
trees to rst using @auto-rst (for some reason rst command never worked
for me properly on my version of Leo), then use rs2pdf to convert the
file properly. Now I'm using rst2latex and pdflatex to get more control
on the pdf output. Leo is a great tool for the creation of your
personalized toolchain for working with data and having a lot of
developments in pythons liks rst2pdt helps with this greatly.
Cheers,
Offray
> On Tue, Nov 8, 2011 at 9:49 AM, mdb <mdbol...@gmail.com> wrote:
> > I vote for using rst2pdf
>
> Thanks for your vote. I'm leaning the same way. I think using
> standard tools wherever possible is a big improvements over hacks like
> leo_pdf.py.
I'm also looking to build this type of toolchain: Leo as the container/
generator and meta-organizer for a tree of plaintext docs. I was
thinking of Leo as just outputting the alternative select/sequencing
paths of output, but now see that it can also manage the external
tools that will be converting the single-source files to their target
(in some case intermediate) filetypes. Although I'm no coder, Leo's
tremendous value may spur me to dip my toes in that water with a bit
of Python scripting if that becomes necessary, although I'm hoping to
stick with batch files/bash scripts if at all possible.
I assume the basics are doc'd on triggering such scripts and external
CLI utility tools to run against individual files, so I'll ask the
higher-value question:
In the case where files are as likely to be modified outside of Leo as
in, is there a way to have Leo check for their modified status in a
whole branch of subdirs, triggering the external executable to run
against any files that been modified? I'd rather not have to re-
generate a whole tree when just a few files are getting changed at any
time.
Or alternatively, does anyone know of a generalized helper utility for
this that would work outside of Leo to:
- watch a dirstruc hierarchy
- track the timestamps of the source files
- run an arbitrary script/executable against and any new or changed
files
Could be windoze or linux, the file trees are getting sync'd around
anyway via unison
Thanks in advance. . .
> From: HansBKK <han...@gmail.com>
> Or alternatively, does anyone know of a generalized helper utility for
> this that would work outside of Leo to:
>
> - watch a dirstruc hierarchy
> - track the timestamps of the source files
> - run an arbitrary script/executable against and any new or changed
> files
`make`? Or `scons`, if you want to use python. Either would need to be able to see the output of the script to see notice that the input was fresher than the output.
Cheers -Terry
From: HansBKK <han...@gmail.com>
To: leo-e...@googlegroups.com
Cc: Terry Brown <terry_...@yahoo.com>
Sent: Monday, December 5, 2011 9:16 PM
Subject: Re: import error for leo_pdf
**wow** that was quick! I'll start googling, below only for those with extra time on their hands 8-)
I've only heard of make in relation to compiling program code from source, but I'll checking it out for this type of usage - links to starting-point howtos for non-programmers would be greatly appreciated.
Does it have the "watch a dirtree for new / changed-since-last-run" functionality built in, or does that require somethings else, say running in cron?
--
You received this message because you are subscribed to the Google Groups "leo-editor" group.
To view this discussion on the web visit https://groups.google.com/d/msg/leo-editor/-/j6bQIbLIzqoJ.
To post to this group, send email to leo-e...@googlegroups.com.
To unsubscribe from this group, send email to leo-editor+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/leo-editor?hl=en.
For what it's worth, I've seen more resurrections on this mailing list
than any other I participate in. It's part of why I stick around,
good ideas don't lie fallow forever. :)
cheers,
--
-matt