def asymptote_scan(node, env, path, arg=None):
"""
+ >>> this_dir = os.path.dirname(__file__)
+ >>> src_dir = os.path.join(this_dir, '..', '..', 'src')
>>> class node (object):
... def __init__(self, path):
... self.path = path
... def srcnode(self):
... return self
>>> for p in asymptote_scan(
- ... node('../../src/figures/cantilever-sim/v-dep.asy'),
+ ... node(os.path.join(src_dir, 'figures', 'cantilever-sim', 'v-dep.asy')),
... None, None, None):
... print p
v-dep.d/v_dep_127_8
v-dep.d/v_dep_27_30
v-dep.d/v_dep_0.1_1
v-dep.d/v_dep_0.1_30
+ v-dep.d/v_dep_127_8.fit.dat
+ v-dep.d/v_dep_27_8.fit.dat
+ v-dep.d/v_dep_127_30.fit.dat
+ v-dep.d/v_dep_27_30.fit.dat
+ v-dep.d/v_dep_0.1_1.fit.dat
+ v-dep.d/v_dep_0.1_30.fit.dat
"""
try:
contents = node.get_text_contents()
def gnuplot_scan(node, env, path, arg=None):
"""
+ >>> this_dir = os.path.dirname(__file__)
+ >>> src_dir = os.path.join(this_dir, '..', '..', 'src')
>>> class node (object):
... def __init__(self, path):
... self.path = path
... def srcnode(self):
... return self
>>> for p in gnuplot_scan(
- ... node('../../src/figures/order-dep/fig.gp'),
+ ... node(os.path.join(src_dir, 'figures', 'order-dep', 'fig.gp')),
... None, None, None):
... print p
data/order.avg-4