def open_sources(args): sources = [ Source(TodoTxt(pathlib.Path(fn).expanduser().resolve())) for fn in args.filename ] for source in sources: if source.filename.exists(): source.parse() return sources
def prepare(todotxt, config): cfg = get_config(config) if len(todotxt) == 0: todotxt = cfg.get('General', 'todotxt-file') if len(todotxt) == 0: raise ValueError(f'No todotxt file given nor configured in {config}') todo = TodoTxt(todotxt) todo.parse() if cfg.getboolean('General', 'usetex'): plt.rc('text', usetex=True) style = cfg.get('General', 'matplotlib-style') if len(style) > 0: plt.style.use(style) return cfg, todo
def setUp(self): self.filename = 'tests/todo.test.txt' self.todo = TodoTxt(self.filename)
def test_no_file(self): with self.assertRaises(IOError): TodoTxt('filenotfound.txt')
def setUp(self): self.filename = 'tests/todo.wellformatted.txt' self.todo = TodoTxt(self.filename)