Add --version parameter and version tracking

pull/510/head
Dakota Benjamin 2017-03-10 14:36:16 -05:00
rodzic bf2069a169
commit cee7b63312
3 zmienionych plików z 15 dodań i 3 usunięć

1
VERSION 100644
Wyświetl plik

@ -0,0 +1 @@
0.3-development

Wyświetl plik

@ -332,6 +332,10 @@ def config():
help='Generates a benchmark file with runtime info\n' help='Generates a benchmark file with runtime info\n'
'Default: %(default)s') 'Default: %(default)s')
#TODO: Add version, gdal options #TODO: Add gdal options
parser.add_argument('--version',
action='store_true',
default=False,
help='Displays version number and exits. ')
return parser.parse_args() return parser.parse_args()

11
run.py
Wyświetl plik

@ -4,6 +4,7 @@ from opendm import log
from opendm import config from opendm import config
from opendm import system from opendm import system
from opendm import io from opendm import io
from opendm import context
import sys import sys
import ecto import ecto
@ -11,6 +12,9 @@ import os
from scripts.odm_app import ODMApp from scripts.odm_app import ODMApp
with open(io.join_paths(context.root_path, 'VERSION')) as version_file:
__version__ = version_file.read().strip()
def usage(): def usage():
log.ODM_ERROR('You must specify a project name:') log.ODM_ERROR('You must specify a project name:')
@ -21,10 +25,13 @@ def usage():
if __name__ == '__main__': if __name__ == '__main__':
log.ODM_INFO('Initializing OpenDroneMap app - %s' % system.now())
args = config.config() args = config.config()
if args.version:
log.ODM_INFO(__version__)
sys.exit(0)
log.ODM_INFO('Initializing OpenDroneMap app - %s' % system.now())
# Force to provide the images path # Force to provide the images path
if args.project_path is None: if args.project_path is None: