[ADD] more fixes

This commit is contained in:
Holger Brunn 2017-04-02 16:29:23 +02:00
parent abe12f6522
commit 6a5ec4e80a
3 changed files with 7 additions and 2 deletions

View File

@ -17,6 +17,7 @@ class DocumentSFTPHandle(SFTPHandle):
return self.attachment.env['document.sftp.root']._file(self.attachment) return self.attachment.env['document.sftp.root']._file(self.attachment)
def read(self, offset, length): def read(self, offset, length):
# pylint: disable=W8106
data = b64decode(self.attachment.datas) data = b64decode(self.attachment.datas)
if offset > len(data): if offset > len(data):
return SFTP_EOF return SFTP_EOF

View File

@ -1,7 +1,11 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# © 2016 Therp BV <http://therp.nl> # © 2016 Therp BV <http://therp.nl>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from paramiko import SFTP_PERMISSION_DENIED, SFTPServerInterface, SFTPServer try:
from paramiko import SFTP_PERMISSION_DENIED, SFTPServerInterface,\
SFTPServer
except ImportError:
pass
from openerp import api from openerp import api

View File

@ -6,7 +6,7 @@ import paramiko
from openerp import tools from openerp import tools
from openerp.modules.registry import RegistryManager from openerp.modules.registry import RegistryManager
from openerp.tests.common import TransactionCase from openerp.tests.common import TransactionCase
from openerp.addons.document_sftp.models.document_sftp import _db2thread from ..models.document_sftp import _db2thread
from ..hooks import post_init_hook from ..hooks import post_init_hook