def run_project(args): options = Options() options.parse(args) if options.known.do_clippings: clip = Clippings(options.known.directory) clip.parse()
class TestCommandLineParameters(unittest.TestCase): def setUp(self): self.options = Options() def test_defaults_options_are_set(self): self.options.parse() self.assertEquals(self.options.known.example, 'example-value') def test_set_options_example(self): self.options.parse(['-x', 'foobar']) self.assertEquals(self.options.known.example, 'foobar') self.options.parse(['--example', 'not-a-foobar']) self.assertEquals(self.options.known.example, 'not-a-foobar')
import os import glob import sys from lib.img_preparing import ImgPreparing from lib.options import Options if __name__ == '__main__': options = Options() opts = options.parse(sys.argv[1:]) img_prepare = ImgPreparing() os.system('rm -rf ' + opts.train_lmdb) os.system('rm -rf ' + opts.validation_lmdb) # Get information about images train_data = [img for img in glob.glob(opts.train)] test_data = [img for img in glob.glob(opts.test)] # Create binary views for files img_prepare.create_lmdb(train_data, opts.train_lmdb) img_prepare.create_lmdb(train_data, opts.validation_lmdb)
def test_lib(): Opt = Options() assert_equal( Opt.parse(['-t', 'source.f']).target, 'source.f')
def _default_options(self): options = Options() options.parse() return options