On Mon, Nov 7, 2011 at 11:50 AM, Stuart Rackham <[email protected]> wrote:
> Hi Lex
>
> I've just committed your a2x patch with a couple of minor changes:
> http://code.google.com/p/asciidoc/source/detail?r=26f6c1f23c8c8364c252360e49b6e89aefbaa7a6

Thanks Stuart, will test soon.

>
> 1. I took the opportunity to simplify the a2x shell() function as the
> original return value wasn't being used.
>
> 2. I renamed the backend  configuration file from a2x.conf to a2x-backend.py
> to distinguish it from the built-in config file and to make it clear that
> it's for the backend and is executable (the a2x.conf should have been YAML
> or JSON, I just took the path of least resistance at the time).
>

And I just took the same path, using a file that a2x already imported.
 A separate name is a good idea.

> 3. Renamed --backend_opts to --backend-opts for consistency.
>

Ah fine, I'll change the backend to use - not _ too.

> Not part of this patch, but I stripped the backend option in your a2x.conf
> else it throws and error if no --backend-opts are specified:
>
> diff --git a/packaged/a2x.conf b/packaged/a2x.conf
> index f9a53c4..1b89a5d 100644
> --- a/packaged/a2x.conf
> +++ b/packaged/a2x.conf
> @@ -75,7 +75,7 @@ class odt_archive:
>
>  def to_odt(self):
>        opts = AttrDict(base_doc=None, temp_dir=None) # TODO default base
> doc?
> -       u = [ o.strip().split('=') for o in self.backend_opts.split('--') if
> o !
> +       u = [ o.strip().split('=') for o in
> self.backend_opts.strip().split('--'
>        opts.update(u)
>        if opts.base_doc is None:
>                die("No base document found")

Will apply.

>
> I can now install asciidoc-odf as a plugin and generate ODT files using
> replacements3 (i.e. no line_break.py filter). Well done guys!
>
> I do have a problem with images, this simple document generates .fodt OK but
> a2x fails:
>
> 8<--------
> The Article Title
> =================
>
> .Tiger block image
> image::tiger.png[Tiger image]
> 8<--------
>
> $ a2x -b odt -v --backend-opts="--base_doc=t.ott" t.txt
>  :
>  :
> Traceback (most recent call last):
>  File "/home/srackham/bin/a2x", line 934, in <module>
>    a2x.execute()
>  File "/home/srackham/bin/a2x", line 356, in execute
>    self.to_backend()
>  File "/home/srackham/bin/a2x", line 608, in to_backend
>    eval('to_%s(self)' % self.backend)
>  File "<string>", line 1, in <module>
>  File "/home/srackham/.asciidoc/backends/odt/a2x-backend.py", line 84, in
> to_odt
>    a.make_archive(opts.base_doc, self.asciidoc_file, odt_file)
>  File "/home/srackham/.asciidoc/backends/odt/a2x-backend.py", line 57, in
> make_archive
>    shutil.copyfile(mc.group(1), os.path.join(td, mc.group(2)))
>  File "/usr/lib/python2.6/shutil.py", line 53, in copyfile
>    fdst = open(dst, 'wb')
> IOError: [Errno 2] No such file or directory:
> '/tmp/tmppTX8PH/Pictures/i_1.png'
>

Ah, I don't create directory Pictures if it doesn't exist in the ott
file, mine has always had one.  Will fix.

Cheers
Lex

-- 
You received this message because you are subscribed to the Google Groups 
"asciidoc" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/asciidoc?hl=en.

Reply via email to