comparison rhodecode/model/notification.py @ 4116:ffd45b185016 rhodecode-2.2.5-gpl

Imported some of the GPLv3'd changes from RhodeCode v2.2.5. This imports changes between changesets 21af6c4eab3d and 6177597791c2 in RhodeCode's original repository, including only changes to Python files and HTML. RhodeCode clearly licensed its changes to these files under GPLv3 in their /LICENSE file, which states the following: The Python code and integrated HTML are licensed under the GPLv3 license. (See: https://code.rhodecode.com/rhodecode/files/v2.2.5/LICENSE or http://web.archive.org/web/20140512193334/https://code.rhodecode.com/rhodecode/files/f3b123159901f15426d18e3dc395e8369f70ebe0/LICENSE for an online copy of that LICENSE file) Conservancy reviewed these changes and confirmed that they can be licensed as a whole to the Kallithea project under GPLv3-only. While some of the contents committed herein are clearly licensed GPLv3-or-later, on the whole we must assume the are GPLv3-only, since the statement above from RhodeCode indicates that they intend GPLv3-only as their license, per GPLv3ยง14 and other relevant sections of GPLv3.
author Bradley M. Kuhn <bkuhn@sfconservancy.org>
date Wed, 02 Jul 2014 19:03:13 -0400
parents 40d50bb7cf2f
children 7e5f8c12a3fc
comparison
equal deleted inserted replaced
4115:8b7294a804a0 4116:ffd45b185016
1 # -*- coding: utf-8 -*- 1 # -*- coding: utf-8 -*-
2 """
3 rhodecode.model.notification
4 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
5
6 Model for notifications
7
8
9 :created_on: Nov 20, 2011
10 :author: marcink
11 :copyright: (C) 2010-2012 Marcin Kuzminski <marcin@python-works.com>
12 :license: GPLv3, see COPYING for more details.
13 """
14 # This program is free software: you can redistribute it and/or modify 2 # This program is free software: you can redistribute it and/or modify
15 # it under the terms of the GNU General Public License as published by 3 # it under the terms of the GNU General Public License as published by
16 # the Free Software Foundation, either version 3 of the License, or 4 # the Free Software Foundation, either version 3 of the License, or
17 # (at your option) any later version. 5 # (at your option) any later version.
18 # 6 #
21 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 9 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 # GNU General Public License for more details. 10 # GNU General Public License for more details.
23 # 11 #
24 # You should have received a copy of the GNU General Public License 12 # You should have received a copy of the GNU General Public License
25 # along with this program. If not, see <http://www.gnu.org/licenses/>. 13 # along with this program. If not, see <http://www.gnu.org/licenses/>.
14 """
15 rhodecode.model.notification
16 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
17
18 Model for notifications
19
20
21 :created_on: Nov 20, 2011
22 :author: marcink
23 :copyright: (c) 2013 RhodeCode GmbH.
24 :license: GPLv3, see LICENSE for more details.
25 """
26
26 27
27 import os 28 import os
28 import logging 29 import logging
29 import traceback 30 import traceback
30 31
253 TYPE_PULL_REQUEST = Notification.TYPE_PULL_REQUEST 254 TYPE_PULL_REQUEST = Notification.TYPE_PULL_REQUEST
254 TYPE_PULL_REQUEST_COMMENT = Notification.TYPE_PULL_REQUEST_COMMENT 255 TYPE_PULL_REQUEST_COMMENT = Notification.TYPE_PULL_REQUEST_COMMENT
255 TYPE_DEFAULT = 'default' 256 TYPE_DEFAULT = 'default'
256 257
257 def __init__(self): 258 def __init__(self):
259 super(EmailNotificationModel, self).__init__()
258 self._template_root = rhodecode.CONFIG['pylons.paths']['templates'][0] 260 self._template_root = rhodecode.CONFIG['pylons.paths']['templates'][0]
259 self._tmpl_lookup = rhodecode.CONFIG['pylons.app_globals'].mako_lookup 261 self._tmpl_lookup = rhodecode.CONFIG['pylons.app_globals'].mako_lookup
260
261 self.email_types = { 262 self.email_types = {
262 self.TYPE_CHANGESET_COMMENT: 'email_templates/changeset_comment.html', 263 self.TYPE_CHANGESET_COMMENT: 'email_templates/changeset_comment.html',
263 self.TYPE_PASSWORD_RESET: 'email_templates/password_reset.html', 264 self.TYPE_PASSWORD_RESET: 'email_templates/password_reset.html',
264 self.TYPE_REGISTRATION: 'email_templates/registration.html', 265 self.TYPE_REGISTRATION: 'email_templates/registration.html',
265 self.TYPE_DEFAULT: 'email_templates/default.html', 266 self.TYPE_DEFAULT: 'email_templates/default.html',
266 self.TYPE_PULL_REQUEST: 'email_templates/pull_request.html', 267 self.TYPE_PULL_REQUEST: 'email_templates/pull_request.html',
267 self.TYPE_PULL_REQUEST_COMMENT: 'email_templates/pull_request_comment.html', 268 self.TYPE_PULL_REQUEST_COMMENT: 'email_templates/pull_request_comment.html',
268 } 269 }
270
269 271
270 def get_email_tmpl(self, type_, **kwargs): 272 def get_email_tmpl(self, type_, **kwargs):
271 """ 273 """
272 return generated template for email based on given type 274 return generated template for email based on given type
273 275