# Path: catkin_tools/terminal_color.py
# def ansi(key):
#     """Returns the escape sequence for a given ansi color key"""
#     global _ansi
#     return _ansi[key]
# 
# Path: catkin_tools/common.py
# def remove_ansi_escape(string):
#     """Removes any ansi escape sequences from a string and returns it"""
#     global _ansi_escape
#     return _ansi_escape.sub('', string)
# 
# Path: catkin_tools/common.py
# def wide_log(msg, **kwargs):
#     """Prints a message to the screen, filling the remainder of the screen with spaces
# 
#     This is useful for printing lines which will completely overwrite previous
#     content printed with a carriage return at the end.
# 
#     If the message is wider than the terminal, then no filling is done.
# 
#     The wide logging can be disabled with :py:func:`disable_wide_log`, in order
#     to prevent queries to the terminal width, which is useful when output is
#     not to a terminal, like when being used with Continuous Integration.
# 
#     Truncating and right hand side messages are disabled when wide_log is
#     disabled as well.
# 
#     When a right hand side message is given, it implies truncate is True.
# 
#     :param msg: message to be printed
#     :type msg: str
#     :param rhs: message to print at the right hand side of the screen
#     :type rhs: str
#     :param truncate: If True, messages wider the then terminal will be truncated
#     :type truncate: bool
#     """
#     try:
#         global wide_log_fn
#         wide_log_fn(msg, **kwargs)
#     except IOError:
#         # This happens when someone ctrl-c's during a log message
#         pass


import os
from catkin_tools.terminal_color import ansi
from catkin_tools.common import remove_ansi_escape
from catkin_tools.common import wide_log
from .color import clr
# Copyright 2014 Open Source Robotics Foundation, Inc.
#
# 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.






class FileBackedLogCache(object):

    def __init__(self, package_name, log_dir, color):
        self.package = package_name
        self.log_dir = log_dir
        self.color = color

# Path: catkin_tools/terminal_color.py
# def ansi(key):
#     """Returns the escape sequence for a given ansi color key"""
#     global _ansi
#     return _ansi[key]
# 
# Path: catkin_tools/common.py
# def remove_ansi_escape(string):
#     """Removes any ansi escape sequences from a string and returns it"""
#     global _ansi_escape
#     return _ansi_escape.sub('', string)
# 
# Path: catkin_tools/common.py
# def wide_log(msg, **kwargs):
#     """Prints a message to the screen, filling the remainder of the screen with spaces
# 
#     This is useful for printing lines which will completely overwrite previous
#     content printed with a carriage return at the end.
# 
#     If the message is wider than the terminal, then no filling is done.
# 
#     The wide logging can be disabled with :py:func:`disable_wide_log`, in order
#     to prevent queries to the terminal width, which is useful when output is
#     not to a terminal, like when being used with Continuous Integration.
# 
#     Truncating and right hand side messages are disabled when wide_log is
#     disabled as well.
# 
#     When a right hand side message is given, it implies truncate is True.
# 
#     :param msg: message to be printed
#     :type msg: str
#     :param rhs: message to print at the right hand side of the screen
#     :type rhs: str
#     :param truncate: If True, messages wider the then terminal will be truncated
#     :type truncate: bool
#     """
#     try:
#         global wide_log_fn
#         wide_log_fn(msg, **kwargs)
#     except IOError:
#         # This happens when someone ctrl-c's during a log message
#         pass


# Path: catkin_tools/jobs/output.py
import os
from catkin_tools.terminal_color import ansi
from catkin_tools.common import remove_ansi_escape
from catkin_tools.common import wide_log
from .color import clr

# Copyright 2014 Open Source Robotics Foundation, Inc.
#
# 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.






class FileBackedLogCache(object):

    def __init__(self, package_name, log_dir, color):
        self.package = package_name
        self.log_dir = log_dir
        self.color = color

        self.log_path = os.path.join(log_dir, self.package + '.log')