/[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.15 by humppake, Mon Feb 10 14:32:44 2003 UTC revision 1.16 by humppake, Mon Feb 10 15:59:07 2003 UTC
# Line 99  def transition_path(from_path, to_path): Line 99  def transition_path(from_path, to_path):
99  #   return transition  #   return transition
100    
101    
102      from_path = os.path.normpath(os.path.abspath(from_path))      print "before:", from_path, "->", to_path
103      to_path = os.path.normpath(os.path.abspath(to_path))      if from_path.startswith("../") or to_path.startswith("../"):
104            from_path = os.path.normpath(os.path.abspath(from_path))
105            to_path = os.path.normpath(os.path.abspath(to_path))
106        print "after:", from_path, "->", to_path
107      depth = from_path.count("/")      depth = from_path.count("/")
108      from_parts = from_path.split("/")      from_parts = from_path.split("/")
109      to_parts = to_path.split("/")      to_parts = to_path.split("/")
# Line 114  def transition_path(from_path, to_path): Line 117  def transition_path(from_path, to_path):
117              break              break
118      result = "".join(["../" for i in range(depth-parts)]) \      result = "".join(["../" for i in range(depth-parts)]) \
119               +"".join([to_parts[i+parts]+"/" for i in range(len(to_parts)-parts)])               +"".join([to_parts[i+parts]+"/" for i in range(len(to_parts)-parts)])
120    
121        print "transition:", result[0:len(result)-1]
122      return (result[0:len(result)-1])      return (result[0:len(result)-1])
123    
124  def mp_directive(name, arguments, options, content, lineno,  def mp_directive(name, arguments, options, content, lineno,

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

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