elyxer-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [eLyXer-users] Re: Advice for another LyX-oriented project


From: Jack Desert
Subject: Re: [eLyXer-users] Re: Advice for another LyX-oriented project
Date: Thu, 1 Apr 2010 14:29:14 -0500

> 
> -----------------------------------------------------------------
> C O A L E S C E . P Y
> 
> When one file in a package calls another file in the same
> package, coalesce.py requires that the second file be called
> from its full package address, not its local relative. For
> example, if there are two source files in Package_A:
> 
>      file_1.py
>      file_2.py
> 
> Then from within file_1.py, to use file_2.py, you must import it like this:
> 
>      import Package_A.file_2
> 
> 
> You will get a "file not found" error if you import it like this:
> 
>      import file_2
> 
> Even though that normally works in Python.


Alex,

I have a patch for coalesce.py and io/fileline.py that allows inter-package 
imports to be made using relative references. I have included two versions of 
this patch-- the first allows only relative references. The second (has a "2" 
suffix) first tries relative references and if that fails, goes with absolute 
references.

This is a boon to my code, since I don't want to have to install the sub 
packages in order to run them individually as unit tests.  Patch2 coalesces 
LyxBlogger just fine. So I went ahead and tested it on elyxer/src/principal.py. 
On principal.py it didn't throw any errors, but the output file is not as big 
as it is supposed to be. So perhaps I've missed something. 


Let me know if this seems useful to you, and we may pursue it further.


-Jack

-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Jack Desert     --    Writer, Entrepeneur
Author and Spokesman: www.LetsEATalready.com
Software Developer:   http://GrooveTask.org
Email: address@hidden
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Attachment: Coalesce-relative-ref.diff
Description: Text Data

Attachment: Coalesce-relative-ref2.diff
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]