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("/") |
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, |