# 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.logger
from moa.sysConf import sysConf
#
# Licensed under the GPL license (see 'COPYING')
#
"""
**completion** - assists command line completion
------------------------------------------------

Caches a number of variables for command line completion

The data is cached in .moa/completion/*

"""


l = moa.logger.getLogger(__name__)



def hook_finish(job):
    """
    cache!!
    """
    #print job, job.isMoa()rm
    if not job.isMoa():
        return

    compdir = os.path.join('.moa', 'completion')
    if not os.path.exists(compdir):
        os.makedirs(compdir)


# 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/completion.py
import os
import moa.logger
from moa.sysConf import sysConf

#
# Licensed under the GPL license (see 'COPYING')
#
"""
**completion** - assists command line completion
------------------------------------------------

Caches a number of variables for command line completion

The data is cached in .moa/completion/*

"""


l = moa.logger.getLogger(__name__)



def hook_finish(job):
    """
    cache!!
    """
    #print job, job.isMoa()rm
    if not job.isMoa():
        return

    compdir = os.path.join('.moa', 'completion')
    if not os.path.exists(compdir):
        os.makedirs(compdir)


    commandlist = sorted(sysConf.commands.keys())