# Path: ratatosk/job.py
# class JobTask(BaseJobTask):
#     def job_runner(self):
#         return DefaultShellJobRunner()
# 
#     def args(self):
#         return []
# 
# Path: ratatosk/log.py
# def get_logger():
#     logger = logging.getLogger('ratatosk-interface')
#     if not logger.handlers:
#         setup_logging()
#     return logger
# 
# Path: ratatosk/report/utils.py
# def group_samples(samples, grouping="sample"):
#     """Group samples by sample or sample run.
# 
#     :param samples: list of :class:`ISample <ratatosk.experiment.ISample>` objects
#     :param grouping: what to group by
# 
#     :returns: dictionary of grouped items
#     """
#     groups = OrderedDict()
#     if grouping == "sample":
#         for k,g in itertools.groupby(samples, key=lambda x:x.sample_id()):
#             groups[k] = list(g)
#     elif grouping == "samplerun":
#         for k,g in itertools.groupby(samples, key=lambda x:x.prefix("samplerun")):
#             groups[k] = list(g)
#     return groups


import os
import luigi
import re
import texttable as tt
import cPickle as pickle
from mako.template import Template
from ratatosk.job import JobTask
from ratatosk.log import get_logger
from ratatosk.report.utils import group_samples
# Copyright (c) 2013 Per Unneberg
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
# the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations under
# the License.


TEMPLATEPATH = os.path.join(os.path.dirname(__file__), os.pardir, "data", "templates", "doc")

templates = {
    'make' : (Template(filename=os.path.join(TEMPLATEPATH, "Makefile.mako")),''),
    'sample' : (Template(filename=os.path.join(TEMPLATEPATH, "source", "samples", "sample.mako")), '.rst'),
    'index' : (Template(filename=os.path.join(TEMPLATEPATH, "source", "index.mako")), '.rst'),
    'sampleindex' : (Template(filename=os.path.join(TEMPLATEPATH, "source", "samples", "index.mako")), '.rst'),
    'conf' : (Template(filename=os.path.join(TEMPLATEPATH, "source", "conf.mako")), '.py')
    }

docdirs = ["build", "source", os.path.join("source", "_static"), os.path.join("source", "_templates"),
           os.path.join("source", "samples")]


# Path: ratatosk/job.py
# class JobTask(BaseJobTask):
#     def job_runner(self):
#         return DefaultShellJobRunner()
# 
#     def args(self):
#         return []
# 
# Path: ratatosk/log.py
# def get_logger():
#     logger = logging.getLogger('ratatosk-interface')
#     if not logger.handlers:
#         setup_logging()
#     return logger
# 
# Path: ratatosk/report/utils.py
# def group_samples(samples, grouping="sample"):
#     """Group samples by sample or sample run.
# 
#     :param samples: list of :class:`ISample <ratatosk.experiment.ISample>` objects
#     :param grouping: what to group by
# 
#     :returns: dictionary of grouped items
#     """
#     groups = OrderedDict()
#     if grouping == "sample":
#         for k,g in itertools.groupby(samples, key=lambda x:x.sample_id()):
#             groups[k] = list(g)
#     elif grouping == "samplerun":
#         for k,g in itertools.groupby(samples, key=lambda x:x.prefix("samplerun")):
#             groups[k] = list(g)
#     return groups


# Path: ratatosk/report/sphinx.py
import os
import luigi
import re
import texttable as tt
import cPickle as pickle
from mako.template import Template
from ratatosk.job import JobTask
from ratatosk.log import get_logger
from ratatosk.report.utils import group_samples

# Copyright (c) 2013 Per Unneberg
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
# the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations under
# the License.


TEMPLATEPATH = os.path.join(os.path.dirname(__file__), os.pardir, "data", "templates", "doc")

templates = {
    'make' : (Template(filename=os.path.join(TEMPLATEPATH, "Makefile.mako")),''),
    'sample' : (Template(filename=os.path.join(TEMPLATEPATH, "source", "samples", "sample.mako")), '.rst'),
    'index' : (Template(filename=os.path.join(TEMPLATEPATH, "source", "index.mako")), '.rst'),
    'sampleindex' : (Template(filename=os.path.join(TEMPLATEPATH, "source", "samples", "index.mako")), '.rst'),
    'conf' : (Template(filename=os.path.join(TEMPLATEPATH, "source", "conf.mako")), '.py')
    }

docdirs = ["build", "source", os.path.join("source", "_static"), os.path.join("source", "_templates"),
           os.path.join("source", "samples")]


logger = get_logger()