From 25c9e325285cb8adda3b29a7d1af4b9eab31ab06 Mon Sep 17 00:00:00 2001 From: David Beal Date: Tue, 23 Feb 2016 21:51:34 +0100 Subject: [PATCH] [FIX] python header in akretion modules --- attachment_metadata/__init__.py | 22 ------------------- attachment_metadata/__openerp__.py | 24 +++------------------ attachment_metadata/attachment.py | 34 +++++++----------------------- 3 files changed, 11 insertions(+), 69 deletions(-) diff --git a/attachment_metadata/__init__.py b/attachment_metadata/__init__.py index 3e53cd607..c14c86359 100644 --- a/attachment_metadata/__init__.py +++ b/attachment_metadata/__init__.py @@ -1,23 +1 @@ -# -*- coding: utf-8 -*- -############################################################################### -# -# Module for OpenERP -# Copyright (C) 2015 Akretion (http://www.akretion.com). -# @author Valentin CHEMIERE -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program 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 Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################### - from . import attachment diff --git a/attachment_metadata/__openerp__.py b/attachment_metadata/__openerp__.py index 232b1f84a..1fed0db4f 100644 --- a/attachment_metadata/__openerp__.py +++ b/attachment_metadata/__openerp__.py @@ -1,24 +1,6 @@ -# -*- coding: utf-8 -*- -############################################################################### -# -# Module for OpenERP -# Copyright (C) 2015 Akretion (http://www.akretion.com). -# @author Valentin CHEMIERE -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program 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 Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################### +# coding: utf-8 +# @ 2015 Valentin CHEMIERE @ Akretion +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). {'name': 'attachment_metadata', 'version': '0.0.1', diff --git a/attachment_metadata/attachment.py b/attachment_metadata/attachment.py index b75ff47a6..85f3da4e9 100644 --- a/attachment_metadata/attachment.py +++ b/attachment_metadata/attachment.py @@ -1,29 +1,11 @@ -# -*- coding: utf-8 -*- -############################################################################### -# -# Module for OpenERP -# Copyright 2011-2012 Camptocamp SA -# @author: Joel Grand-Guillaume -# Copyright (C) 2015 Akretion (http://www.akretion.com). -# @author Valentin CHEMIERE -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program 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 Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################### +# coding: utf-8 +# Copyright (C) 2014 initOS GmbH & Co. KG (). +# @author: Joel Grand-Guillaume @ Camptocamp SA +# @ 2015 Valentin CHEMIERE @ Akretion +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from openerp import models, fields, api, _ -from openerp.exceptions import Warning +from openerp.exceptions import Warning as UserError import hashlib from base64 import b64decode @@ -42,6 +24,6 @@ class IrAttachmentMetadata(models.Model): if self.datas: self.internal_hash = hashlib.md5(b64decode(self.datas)).hexdigest() if self.external_hash and self.internal_hash != self.external_hash: - raise Warning(_('File corrupted'), - _("Something was wrong with the retreived file, " + raise UserError(_('File corrupted'), + _("Something was wrong with the retreived file, " "please relaunch the task."))