MCPcopy Create free account
hub / github.com/Kitware/VTK / processCmdLine

Function processCmdLine

Wrapping/Python/vtkmodules/test/Testing.py:529–580  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

527
528
529def processCmdLine():
530 opts, args = parseCmdLine()
531
532 global VTK_DATA_ROOT, VTK_BASELINE_ROOT, VTK_TEMP_DIR, VTK_BASELINE_PATHS
533 global _VERBOSE, _NO_IMAGE, _INTERACT
534
535 # setup defaults
536 try:
537 VTK_DATA_ROOT = os.environ['VTK_DATA_ROOT']
538 except KeyError:
539 VTK_DATA_ROOT = os.path.normpath("../../../../../VTKData")
540
541 try:
542 VTK_BASELINE_ROOT = os.environ['VTK_BASELINE_ROOT']
543 except KeyError:
544 pass
545
546 try:
547 VTK_TEMP_DIR = os.environ['VTK_TEMP_DIR']
548 except KeyError:
549 VTK_TEMP_DIR = os.path.normpath("../../../../Testing/Temporary")
550
551 for o, a in opts:
552 if o in ('-D', '--data-dir'):
553 oa = os.path.abspath(a)
554 if os.path.isfile(oa):
555 VTK_DATA_PATHS.append(oa)
556 else:
557 VTK_DATA_ROOT = oa
558 if o in ('-B', '--baseline-root'):
559 VTK_BASELINE_ROOT = os.path.abspath(a)
560 if o in ('-T', '--temp-dir'):
561 VTK_TEMP_DIR = os.path.abspath(a)
562 if o in ('-V', '--validated-output'):
563 VTK_BASELINE_PATHS.append(os.path.abspath(a))
564 if o in ('-n', '--no-image'):
565 _NO_IMAGE = 1
566 if o in ('-I', '--interact'):
567 _INTERACT = 1
568 if o in ('-v', '--verbose'):
569 try:
570 _VERBOSE = int(a)
571 except:
572 msg="Verbosity should be an integer. 0, 1, 2 are valid."
573 print(msg)
574 sys.exit(1)
575 if o in ('-h', '--help'):
576 print(usage())
577 sys.exit()
578
579 if not VTK_BASELINE_ROOT: # default value.
580 VTK_BASELINE_ROOT = VTK_DATA_ROOT
581
582
583

Callers 1

mainFunction · 0.85

Calls 5

parseCmdLineFunction · 0.85
usageFunction · 0.70
printFunction · 0.50
appendMethod · 0.45
exitMethod · 0.45

Tested by

no test coverage detected