Coverage for janitoo.utils : 71%

Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
# -*- coding: utf-8 -*-
"""
This file is part of Janitoo.
Janitoo is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
Janitoo is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty 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 Janitoo. If not, see <http://www.gnu.org/licenses/>.
"""
"""This is a decorator which can be used to mark functions as deprecated. It will result in a warning being emmitted when the function is used.""" def new_func(*args, **kwargs): warnings.simplefilter('always', DeprecationWarning)#turn off filter warnings.warn("Call to deprecated function {}.".format(func.__name__), category=DeprecationWarning, stacklevel=2) warnings.simplefilter('default', DeprecationWarning) #reset filter return func(*args, **kwargs) new_func.__name__ = func.__name__ new_func.__doc__ = func.__doc__ new_func.__dict__.update(func.__dict__) return new_func
""" Exception class for Janitoo """ Exception.__init__(self, exx) self.message = message
return repr(self.message)
""" Not Implemented Exception class for Janitoo """ JanitooException.__init__(self, "Janitoo Not Implemented Exception", message=message, )
""" Runtime Exception class for Janitoo """ JanitooException.__init__(self, "Janitoo Runtime Exception", message=message, )
except ValueError: logger.debug("mqtt_on_heartbeat can't convert add_ctrl %s to integer", sadd_ctrl) return None, None except ValueError: logger.debug("mqtt_on_heartbeat can't convert add_node %s to integer", sadd_node) return None, None |