/[gzz]/gzz/metacode/mputils.py
ViewVC logotype

Diff of /gzz/metacode/mputils.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.14 by humppake, Mon Feb 10 14:07:43 2003 UTC revision 1.15 by humppake, Mon Feb 10 14:32:44 2003 UTC
# Line 86  def _slashify(path): Line 86  def _slashify(path):
86    
87  def transition_path(from_path, to_path):  def transition_path(from_path, to_path):
88      """      """
89      The current implementation sucks, so why wouldn't use      Returns the transition path from from_path to to_path.
     something ready and working :)  
90      """      """
91      from_path = os.path.normpath(os.path.abspath(from_path))  
92      to_path = os.path.normpath(os.path.abspath(to_path))  ##   Tried to use docutils.utils.relative_path instead of this, but
93    ##   it crashed with Jython :( e.g. relative_path("", "") raised a
94    ##   java.lang.NegativeArraySizeException
95    
96  #   print "from:", from_path, "to:", to_path+"/foo"  #   print "from:", from_path, "to:", to_path+"/foo"
97  #   terrible kludge to avoid java.lang.NegativeArraySizeException with Jython  #   transition = docutils.utils.relative_path(from_path, to_path)
     transition = docutils.utils.relative_path(from_path+"/foo", to_path)  
     if transition.startswith("../"):  
         transition = transition[3:len(transition)]  
98  #   print "transition:", transition  #   print "transition:", transition
99      return transition  #   return transition
100    
101      """  
102      Returns the transition path from from_path to to_path.      from_path = os.path.normpath(os.path.abspath(from_path))
103      """      to_path = os.path.normpath(os.path.abspath(to_path))
104      depth = from_path.count("/")      depth = from_path.count("/")
105      from_parts = from_path.split("/")      from_parts = from_path.split("/")
106      to_parts = to_path.split("/")      to_parts = to_path.split("/")

Legend:
Removed from v.1.14  
changed lines
  Added in v.1.15

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26