File: lsmpython

package info (click to toggle)
esys-particle 2.1-4
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 7,284 kB
  • sloc: cpp: 77,304; python: 5,647; makefile: 1,176; sh: 10
file content (24 lines) | stat: -rw-r--r-- 489 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/usr/bin/env python
from esys.lsm.util import InstallInfo
from esys.lsm.util import PathSearcher

import os
import sys

python = PathSearcher().find("python")
argList = []
if (len(sys.argv) > 1):
    moduleName = sys.argv[1]
    exec("import " + moduleName)
    moduleFileName = eval(moduleName + ".__file__")
    argList.append(moduleFileName)
    if (len(sys.argv) > 2):
      argList += sys.argv[2:]

os.execv(
  python,
  [
    os.path.split(python)[1], # argv[0]
  ] +\
  argList
)