Esempio n. 1
0
def run_project(args):
    options = Options()
    options.parse(args)

    if options.known.do_clippings:
        clip = Clippings(options.known.directory)
        clip.parse()
Esempio n. 2
0
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')
Esempio n. 3
0
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)

Esempio n. 4
0
def test_lib():
	Opt = Options()
	assert_equal(	Opt.parse(['-t', 'source.f']).target,
				 	'source.f')
Esempio n. 5
0
 def _default_options(self):
     options = Options()
     options.parse()
     return options