On Wednesday 28 April 2004 12:39, Georg Baum wrote:
> I wrote a lyx2lyx conversion function (since this is a file format
> change), but it does not work if the input file is fed to lyx2lx via
> stdin. Since lyx invokes lyx2lyx with the input filename on the
> commandline, I think we can live with that.

  I agree. I notice that you warn the user about this, good.

  Why don't you use the new error and warnings framework?

  opt.warning("""Warning: Can not determine wether file
        %s
        needs an extension when reading from standard input.
        You may need to correct the file manually or
        run lyx2lyx again with the .lyx file as commandline argument.
""" % filename)

  You must agree that this easier to read, than what you have. ;-)

> Another lyx2lyx problem is that the "import as" syntax is not
> supported by python 1.5. I need that to avoid a name clash between
> string.join and os.path.join.
> Angus proposed to use string.join(...) and path.join(...). This
> requires to import the whole os.path and string module (correct me if
> I am wrong). José, is this the preferred way to import, or do you
> have another solution?

  The namespace issue is the same as in C++, in this case we say 
explicitly which functions we are using from any given module.

  If you want to use this style without the new "import as" I would 
expect this to work:

from os.path import join
joinpath = join
from string import join

  Then you can use join and joinpath. :-)

> Is the attached ok, or are there any reasons to keep the current
> filename syntax?

  None that I know. :-)
-- 
José Abílio

LyX and docbook, a perfect match. :-)

Reply via email to