# 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 re
import json
import socket
import subprocess as sp
import moa.ui
import moa.logger
from moa.sysConf import sysConf
        annotations = item.get('annotations', [])

        for anno in annotations:
            desc = anno.get('description', '')
            if not 'uid:' in desc:
                continue

    pidlist = out.strip().split()
    if len(pidlist) > 1:
        #moa.ui.warn("multiple jobs with this job's uid - not good")
        return pidlist[-1]

    if len(pidlist) == 1:
        return pidlist[0]

    project = job.conf.get('project', 'no_project')
    title = job.conf.get('title')

    cl = ['task', 'add',
          'project:"%s"' % project,
          '+moa', '--', title]

    P = sp.Popen(cl, stdout=sp.PIPE, stderr=sp.PIPE)
    out, err = P.communicate()
    taskid = re.search('Created task ([0-9]+)', out).groups()[0]
    moa.ui.message("new taskwarrior task %s" % taskid)

    runTask("task %s annotate uid:%s-%s" % (taskid, job.conf.ppud,
                                            job.conf.pud))


# 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/task.py
import re
import json
import socket
import subprocess as sp
import moa.ui
import moa.logger
from moa.sysConf import sysConf

        annotations = item.get('annotations', [])

        for anno in annotations:
            desc = anno.get('description', '')
            if not 'uid:' in desc:
                continue

    pidlist = out.strip().split()
    if len(pidlist) > 1:
        #moa.ui.warn("multiple jobs with this job's uid - not good")
        return pidlist[-1]

    if len(pidlist) == 1:
        return pidlist[0]

    project = job.conf.get('project', 'no_project')
    title = job.conf.get('title')

    cl = ['task', 'add',
          'project:"%s"' % project,
          '+moa', '--', title]

    P = sp.Popen(cl, stdout=sp.PIPE, stderr=sp.PIPE)
    out, err = P.communicate()
    taskid = re.search('Created task ([0-9]+)', out).groups()[0]
    moa.ui.message("new taskwarrior task %s" % taskid)

    runTask("task %s annotate uid:%s-%s" % (taskid, job.conf.ppud,
                                            job.conf.pud))


    sysConf.plugins.task.id = taskid