Fixed parser options for NodeODM compatibility

Former-commit-id: cf704b5058
pull/1161/head
Piero Toffanin 2020-03-18 16:19:38 -04:00
rodzic fbeaf2bac7
commit aa8e55ca2f
2 zmienionych plików z 4 dodań i 12 usunięć

Wyświetl plik

@ -60,18 +60,17 @@ class StoreValue(argparse.Action):
setattr(namespace, self.dest, values)
setattr(namespace, self.dest + '_is_set', True)
parser = SettingsParser(description='OpenDroneMap',
usage='%(prog)s [options] <project name>',
yaml_file=open(context.settings_path))
args = None
def config(argv=None, settings_yaml=context.settings_path):
def config(argv=None):
global args
if args is not None and argv is None:
return args
parser = SettingsParser(description='OpenDroneMap',
usage='%(prog)s [options] <project name>',
yaml_file=open(settings_yaml))
parser.add_argument('--project-path',
metavar='<path>',
action=StoreValue,

Wyświetl plik

@ -37,13 +37,6 @@ class TestOSFM(unittest.TestCase):
self.assertEqual(get_submodel_argv(args, "/submodels", "submodel_0000")[1:],
['--crop', '0.015625', '--orthophoto-cutline', '--dem-euclidean-map', '--skip-3dmodel', '--project-path', '/submodels', 'submodel_0000'])
# Using settings.yaml with project-path
args = config.config(["brighton"], os.path.join(os.path.dirname(os.path.realpath(__file__)), "assets", "settings.yaml"))
self.assertEqual(get_submodel_argv(args)[1:],
['--orthophoto-cutline', '--dem-euclidean-map', '--skip-3dmodel'])
self.assertEqual(get_submodel_argv(args, "/submodels", "submodel_0000")[1:],
['--orthophoto-cutline', '--dem-euclidean-map', '--skip-3dmodel', '--project-path', '/submodels', 'submodel_0000'])
# With sm-cluster, pc-csv and others
args = config.config(["--project-path", "/datasets", "--split", "200", "--pc-csv"])
self.assertEqual(get_submodel_argv(args)[1:],