def __init__(self): # try to minimize the performance penalty for every request - this # will not change anyway during the lifetime of this Component self._uses_incompatible_trac_version = VersionChecker( ).is_trac_incompatible_with_python() self._is_bad_path = PathNameChecker().is_bad_path() if self._uses_incompatible_trac_version: self.env.log.error(self._warn_message_about_old_trac()) if self._is_bad_path: self.env.log.error(self._warn_message_about_unicode_path())
def post_process_request(self, req, template, data, content_type): """ Modify the data of a request and substitutes ticket type names with alias names. Always returns the request template and content_type unchanged. """ if data is None: data = dict() self._substitute_ticket_types_with_aliases_in_request_arguments(req) self._substitute_ticket_types_with_aliases_in_genshi_data(data) config = AgiloConfig(self.env) data['agilo_ticket_types'] = config.ALIASES.items() data['create_perm'] = self.create_permissions(req) data['agilo_version'] = VersionChecker().agilo_version() self._inject_agilo_ui_for_this_request(req, data) self._inject_processing_time(req, data) return template, data, content_type
def python_version_tuple(python=None): return VersionChecker(python=python).python_version_tuple()
def is_trac_compatible(self, python=None, trac=None): checker = VersionChecker(python=python, trac=trac) return checker.is_trac_compatible_with_python()
def _warn_message_about_old_trac(self): checker = VersionChecker() msg = _('Your version of of trac (%s) is not compatible with your ' 'Python version (%s)') % (checker.trac_version(), checker.python_version()) return msg
def __init__(self, *args, **kwargs): """Initialize the template provider for Agilo""" super(CoreTemplateProvider, self).__init__(*args, **kwargs) self._alias_to_type = {} self.config_reloaded() self.env.systeminfo.append(('Agilo', VersionChecker().agilo_version()))