|
From: Kenichi S. <Ken...@jp...> - 2002-08-22 12:23:32
|
In the message "Re: [Docutils-develop] Re: Strange --stylesheet handling..."
on Wed, 21 Aug 2002 22:46:44 -0400, David Goodger <go...@us...> wrote:
> Kenichi Sato wrote:
> > I believe we can implement relative_uri() so that it returns
> > "default.css" for the case 1 and "../xyz/default.css" for the
> > case 4.
>
> If you'd like to give it a try, patches are very welcome.
Oops. Ok, I tried. The following patch seems working for me.
Index: utils.py
===================================================================
RCS file: /cvsroot/docutils/docutils/docutils/utils.py,v
retrieving revision 1.11
diff -c -r1.11 utils.py
*** utils.py 21 Aug 2002 02:43:46 -0000 1.11
--- utils.py 22 Aug 2002 12:04:24 -0000
***************
*** 364,370 ****
"""
source_parts = os.path.abspath(source).split(os.sep)
target_parts = os.path.abspath(target).split(os.sep)
! if source_parts[:2] != target_parts[:2]:
# Nothing in common between paths. Return absolute path.
return '/'.join(target_parts)
source_parts.reverse()
--- 364,370 ----
"""
source_parts = os.path.abspath(source).split(os.sep)
target_parts = os.path.abspath(target).split(os.sep)
! if source_parts[0] != target_parts[0]:
# Nothing in common between paths. Return absolute path.
return '/'.join(target_parts)
source_parts.reverse()
> > Wow, it's in Japanese.
>
> I lived in Gunma for 3 years and Tokyo for 4 years (Minato-ku,
> Shibaura). My wife is Japanese, so I get to practise.
I see.
--
Kenichi SATO
|