MCPcopy
hub / github.com/programthink/zhao / do

Method do

bin/make.py:271–288  ·  view source on GitHub ↗
(self, file_type)

Source from the content-addressed store, hash-verified

269 return os.system(cmd.encode(u'utf-8'))
270
271 def do(self, file_type) :
272 os.chdir(u'../download/')
273 self._mkdir(u'dot')
274 self._mkdir(file_type)
275 n = 0
276 for graph in _load_yaml(u'../data/graph.yaml') :
277 n += 1
278 name = u'%02d-%s' % (n, graph[u'name'])
279 dot_file = u'./dot/%s.dot' % (name,)
280 output_file = u'./%s/%s.%s' % (file_type, name, file_type)
281
282 with open(dot_file, u'wb') as f :
283 f.write(Graph(graph).dump().encode(u'utf-8'))
284
285 cmd = u'dot "%s" -T%s -o"%s"' % (dot_file, file_type, output_file)
286 if self._exec(cmd) != 0 :
287 _raise_err(u'Make "%s" failed!', dot_file)
288 return 0
289
290
291if '__main__' == __name__ :

Callers 1

make.pyFile · 0.80

Calls 6

_mkdirMethod · 0.95
_execMethod · 0.95
_load_yamlFunction · 0.85
GraphClass · 0.85
_raise_errFunction · 0.85
dumpMethod · 0.80

Tested by

no test coverage detected