# Path: moa/sysConf.py
# USERCONFIGFILE = os.path.join(os.path.expanduser('~'),
#                               '.config', 'moa', 'config')
# SYSCONFIGFILE = os.path.join('etc', 'moa', 'config')
# def _interpret_var(v):
#     def __init__(self):
#     def getUser(self):
#     def saveUser(self, conf):
#     def getVersion(self):
# class SysConf(Yaco.Yaco):


import os
import stat
import subprocess as sp
import sys
import tempfile
import jinja2
import moa.logger
import moa.ui
from moa.sysConf import sysConf
        tf.write("\n".join(_script))
    else:
        tf.write(str(_script))

    tf.close()
    os.chmod(tf.name, stat.S_IRUSR | stat.S_IWUSR | stat.S_IXUSR)
    return tf.name


@moa.actor.async
def parallelRunner(wd, cl, conf={}, **kwargs):
    """
    Run the job using PARALLEL

    what does this function do?
    - put env in the environment
    - Execute the commandline (in cl)
    - store stdout & stderr in log files
    - return the rc
    """

    # see if we can get a command
    command = kwargs.get('command', 'unknown')

    if command == 'unknown':
        l.critical("runner should be called with a command")
        sys.exit(-1)

    l.debug("starting parallel actor for %s" % command)


# Path: moa/sysConf.py
# USERCONFIGFILE = os.path.join(os.path.expanduser('~'),
#                               '.config', 'moa', 'config')
# SYSCONFIGFILE = os.path.join('etc', 'moa', 'config')
# def _interpret_var(v):
#     def __init__(self):
#     def getUser(self):
#     def saveUser(self, conf):
#     def getVersion(self):
# class SysConf(Yaco.Yaco):


# Path: moa/plugin/job/parallelActor.py
import os
import stat
import subprocess as sp
import sys
import tempfile
import jinja2
import moa.logger
import moa.ui
from moa.sysConf import sysConf

        tf.write("\n".join(_script))
    else:
        tf.write(str(_script))

    tf.close()
    os.chmod(tf.name, stat.S_IRUSR | stat.S_IWUSR | stat.S_IXUSR)
    return tf.name


@moa.actor.async
def parallelRunner(wd, cl, conf={}, **kwargs):
    """
    Run the job using PARALLEL

    what does this function do?
    - put env in the environment
    - Execute the commandline (in cl)
    - store stdout & stderr in log files
    - return the rc
    """

    # see if we can get a command
    command = kwargs.get('command', 'unknown')

    if command == 'unknown':
        l.critical("runner should be called with a command")
        sys.exit(-1)

    l.debug("starting parallel actor for %s" % command)


    if not command in sysConf.job.data.parallel.scripts: