# 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 moa.ui
import moa.utils
import moa.args
import subprocess as sp
import moa.logger
from moa.sysConf import sysConf

    try:
        last_run_id = int(open(run_id_file).read())
    except:
        #not worth crashing
        l.warning("Could not retrieve last run id")
        return 0, {}

    l.debug("last_run_id: %d" % last_run_id)

    for i in range(no):
        avd[last_run_id - i] = _get_specific_versioninfo(last_run_id - i)

    return last_run_id, avd


def hook_pelican(job):
    l.debug("pelican versioning output")
    nov = 10
    last_run_id, vinfo = _get_last_versioninfo(nov)
    vrange = list(reversed(sorted(range(last_run_id, last_run_id - nov, -1))))
    if last_run_id == 0 or vinfo == {}:
        l.warning("cannot create version info page")
        return

    allkeys = set()
    for rid in vinfo:
        allkeys.update(set(vinfo[rid]))
    allkeys = sorted(list(allkeys))


# 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/versioning.py
import os
import moa.ui
import moa.utils
import moa.args
import subprocess as sp
import moa.logger
from moa.sysConf import sysConf


    try:
        last_run_id = int(open(run_id_file).read())
    except:
        #not worth crashing
        l.warning("Could not retrieve last run id")
        return 0, {}

    l.debug("last_run_id: %d" % last_run_id)

    for i in range(no):
        avd[last_run_id - i] = _get_specific_versioninfo(last_run_id - i)

    return last_run_id, avd


def hook_pelican(job):
    l.debug("pelican versioning output")
    nov = 10
    last_run_id, vinfo = _get_last_versioninfo(nov)
    vrange = list(reversed(sorted(range(last_run_id, last_run_id - nov, -1))))
    if last_run_id == 0 or vinfo == {}:
        l.warning("cannot create version info page")
        return

    allkeys = set()
    for rid in vinfo:
        allkeys.update(set(vinfo[rid]))
    allkeys = sorted(list(allkeys))


    jenv = sysConf.plugins.pelican.jenv