Esempio n. 1
0
 def _do(self, action, config, *args):
     config_file = self._config(config)
     config_dir = os.path.dirname(config_file)
     p = OptionParser()
     y = YaybuCmd(config_file, ypath=(config_dir, ))
     y.Config = self.Config
     y.verbose = 2
     y.debug = True
     getattr(y, "opts_" + action)(p)
     return getattr(y, "do_" + action)(*p.parse_args(list(args)))
Esempio n. 2
0
File: base.py Progetto: yaybu/yaybu
 def _get_graph(self, config, *args):
     config_file = self._config(config)
     config_dir = os.path.dirname(config_file)
     p = OptionParser()
     y = YaybuCmd(config_file, ypath=(config_dir, ))
     y.Config = self.Config
     y.verbose = 2
     y.debug = True
     y.opts_up(p)
     return y._get_graph(*p.parse_args(list(args)))