20 |
""" |
""" |
21 |
import os, sys, re |
import os, sys, re |
22 |
import docutils.parsers.rst.directives, docutils.nodes, docutils.core |
import docutils.parsers.rst.directives, docutils.nodes, docutils.core |
23 |
import docutils |
import docutils, docutils.utils |
24 |
import uml |
import uml |
25 |
|
|
26 |
|
|
56 |
Stores global settings for metapost actions. |
Stores global settings for metapost actions. |
57 |
""" |
""" |
58 |
settings = Settings() |
settings = Settings() |
59 |
settings['tmpdir'] = os.path.abspath('doc/uml') |
settings['tmpdir'] = 'doc/uml' |
60 |
|
|
61 |
#Environmental variable MPINPUTS should be relative to tmpdir, |
#Environmental variable MPINPUTS should be relative to tmpdir, |
62 |
#or be an absolute path. |
#or be an absolute 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 |
90 |
|
something ready and working :) |
91 |
|
""" |
92 |
|
#terrible kludge to avoid java.lang.NegativeArraySizeException with Jython |
93 |
|
from_path = os.path.normpath(os.path.abspath(from_path)) |
94 |
|
to_path = os.path.normpath(os.path.abspath(to_path)) |
95 |
|
# print "from:", from_path, "to:", to_path+"/foo" |
96 |
|
transition = docutils.utils.relative_path(from_path+"/foo", to_path) |
97 |
|
transition = transition[3:len(transition)] |
98 |
|
# print "transition:", transition |
99 |
|
return transition |
100 |
|
|
101 |
|
""" |
102 |
Returns the transition path from from_path to to_path. |
Returns the transition path from from_path to to_path. |
103 |
""" |
""" |
104 |
depth = from_path.count("/") |
depth = from_path.count("/") |