|
@@ -9,7 +9,6 @@ import time
|
|
import sys
|
|
import sys
|
|
import logging
|
|
import logging
|
|
import os
|
|
import os
|
|
-import subprocess
|
|
|
|
import itertools
|
|
import itertools
|
|
|
|
|
|
from .mpp import log
|
|
from .mpp import log
|
|
@@ -18,26 +17,16 @@ from .mpp.internal import loader as plugin_loader
|
|
def main():
|
|
def main():
|
|
|
|
|
|
os.environ['METRIXPLUSPLUS_INSTALL_DIR'] = os.path.dirname(os.path.abspath(__file__))
|
|
os.environ['METRIXPLUSPLUS_INSTALL_DIR'] = os.path.dirname(os.path.abspath(__file__))
|
|
-
|
|
|
|
- exemode = None
|
|
|
|
- if len(sys.argv[1:]) != 0:
|
|
|
|
- exemode = sys.argv[1]
|
|
|
|
- if exemode != "-R" and exemode != "-D":
|
|
|
|
- exemode = '-D' # TODO implement install and release mode
|
|
|
|
- # inject '-D' or '-R' option
|
|
|
|
- #profile_args = ['-m', 'cProfile']
|
|
|
|
- profile_args = []
|
|
|
|
- exit(subprocess.call(itertools.chain([sys.executable], profile_args, [sys.argv[0], '-D'], sys.argv[1:])))
|
|
|
|
|
|
|
|
command = ""
|
|
command = ""
|
|
- if len(sys.argv[1:]) > 1:
|
|
|
|
- command = sys.argv[2]
|
|
|
|
|
|
+ if len(sys.argv) > 1:
|
|
|
|
+ command = sys.argv[1]
|
|
|
|
|
|
loader = plugin_loader.Loader()
|
|
loader = plugin_loader.Loader()
|
|
mpp_paths = []
|
|
mpp_paths = []
|
|
if 'METRIXPLUSPLUS_PATH' in list(os.environ.keys()):
|
|
if 'METRIXPLUSPLUS_PATH' in list(os.environ.keys()):
|
|
mpp_paths = os.environ['METRIXPLUSPLUS_PATH'].split(os.pathsep)
|
|
mpp_paths = os.environ['METRIXPLUSPLUS_PATH'].split(os.pathsep)
|
|
- args = loader.load(command, mpp_paths, sys.argv[3:])
|
|
|
|
|
|
+ args = loader.load(command, mpp_paths, sys.argv[2:])
|
|
exit_code = loader.run(args)
|
|
exit_code = loader.run(args)
|
|
loader.unload()
|
|
loader.unload()
|
|
return exit_code
|
|
return exit_code
|