# Path: tracer/resources/exceptions.py
# class PathNotFound(OSError, Printable):
# 
# 	@property
# 	def message(self):
# 		return _(
# 			"Problem occurred - neither one of {0} paths exists\n"
# 			"Please contact maintainer of tracer package in your distribution.")
# 
# 	def __init__(self, name):
# 		OSError.__init__(self, self.message.format(name))
# 
# class TracerError(Exception, Printable):
# 	"""
# 	Unspecified tracer error
# 	"""
# 	def __init__(self, message):
# 		self.message = message


from xml.dom import minidom
from xml.parsers.expat import ExpatError
from tracer.paths import DATA_DIR, USER_CONFIG_DIRS
from tracer.resources.exceptions import PathNotFound, TracerError
from os.path import dirname
# Copyright (C) 2016 Jakub Kadlcik
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
# the GNU General Public License v.2, or (at your option) any later version.
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY expressed or implied, including the implied warranties of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General
# Public License for more details.  You should have received a copy of the
# GNU General Public License along with this program; if not, write to the
# Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
# 02110-1301, USA.
#

from __future__ import absolute_import



class Rules(object):

	DEFINITIONS = map(lambda x: x + "/rules.xml", [DATA_DIR] + USER_CONFIG_DIRS)

	ACTIONS = {
		"CALL-PARENT"  :  "call-parent",
		"RETURN"        :  "return",
	}
	_DEFAULT_ACTION = ACTIONS["CALL-PARENT"]
	_rules = None

	@staticmethod

# Path: tracer/resources/exceptions.py
# class PathNotFound(OSError, Printable):
# 
# 	@property
# 	def message(self):
# 		return _(
# 			"Problem occurred - neither one of {0} paths exists\n"
# 			"Please contact maintainer of tracer package in your distribution.")
# 
# 	def __init__(self, name):
# 		OSError.__init__(self, self.message.format(name))
# 
# class TracerError(Exception, Printable):
# 	"""
# 	Unspecified tracer error
# 	"""
# 	def __init__(self, message):
# 		self.message = message


# Path: tracer/resources/rules.py
from xml.dom import minidom
from xml.parsers.expat import ExpatError
from tracer.paths import DATA_DIR, USER_CONFIG_DIRS
from tracer.resources.exceptions import PathNotFound, TracerError
from os.path import dirname

# Copyright (C) 2016 Jakub Kadlcik
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
# the GNU General Public License v.2, or (at your option) any later version.
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY expressed or implied, including the implied warranties of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General
# Public License for more details.  You should have received a copy of the
# GNU General Public License along with this program; if not, write to the
# Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
# 02110-1301, USA.
#

from __future__ import absolute_import



class Rules(object):

	DEFINITIONS = map(lambda x: x + "/rules.xml", [DATA_DIR] + USER_CONFIG_DIRS)

	ACTIONS = {
		"CALL-PARENT"  :  "call-parent",
		"RETURN"        :  "return",
	}
	_DEFAULT_ACTION = ACTIONS["CALL-PARENT"]
	_rules = None

	@staticmethod

	def find(app_name):