Table of Contents
System module for the MineSight® Grail. This module contains some of the major system components used throughout all of MineSight® Grail.
New in version 4.70.
Utility for quickly letting you define the 'standard' gmain entry point for all MineSight(r) scripts.
from grail import gsys
def run():
# Run my code...
gmain = gsys.GMAIN(run, __name__)
gmain.run()
This little snippet will execute your main_function if you are running from the command line OR if you are running from within MS3D. This is determined by inspecting the name argument.
The object returned must be named gmain.
The gmain object can also be queried for further properties, namely,
Some examples are,
from grail import gsys
def run():
if gmain.is_cl:
params, options = parse_args(gmain.args)
else:
params, options = get_defaults()
do_something(params, options)
gmain = gsys.GMAIN(run, __name__)
gmain.run()
you can see that the gmain object will have properties that indicate the context that the script was executed in.
Generic catch-all main function.
This allows us to write scripts and feed messages and data off to one place for all scripts.
An example of using this involves using gmain(),