From e7f1b95d45e9e2ba72440c78e8a82af2004f4af1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A5=D0=B8=D1=80=D0=B5=D1=86=D0=BA=D0=B8=D0=B9=20=D0=9C?= =?UTF-8?q?=D0=B8=D1=85=D0=B0=D0=B8=D0=BB?= Date: Thu, 20 Dec 2018 17:59:22 +0300 Subject: [PATCH] =?UTF-8?q?=D0=A0=D0=B5=D1=84=D0=B0=D0=BA=D1=82=D0=BE?= =?UTF-8?q?=D1=80=D0=B8=D0=BD=D0=B3:=20=D1=80=D0=B0=D0=B1=D0=BE=D1=82?= =?UTF-8?q?=D0=B0=20=D1=81=20=D1=84=D0=B0=D0=B9=D0=BB=D0=B0=D0=BC=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pym/client/client.py | 8 ++++---- pym/client/client_cache.py | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pym/client/client.py b/pym/client/client.py index 36809e2..b301308 100644 --- a/pym/client/client.py +++ b/pym/client/client.py @@ -30,7 +30,7 @@ from calculate.lib.cl_ini_parser import iniParser from calculate.lib.cl_print import color_print from calculate.lib.utils.ip import Pinger, IPError from calculate.lib.utils.files import (getModeFile, removeDir, - pathJoin, tarLinks, + pathJoin, tarLinks, readFile, listDirectory, process, find, STDOUT, checkUtils) from calculate.lib.utils.samba import Samba, SambaError @@ -890,7 +890,7 @@ class Client(commandServer, encrypt, Desktop): """ # read file list from config try: - filesProfileTxt = open(pathListFile).read() + filesProfileTxt = readFile(pathListFile) except IOError: return False listFilesProfile = filter(lambda x: x.strip(), @@ -928,8 +928,8 @@ class Client(commandServer, encrypt, Desktop): try: if os.path.exists(cmdLineFile) and \ os.path.exists(environFile): - return (open(cmdLineFile, 'r').read().strip(), - open(environFile, 'r').read().strip()) + return (readFile(cmdLineFile).strip(), + readFile(environFile).strip()) except (OSError, IOError): pass return "", "" diff --git a/pym/client/client_cache.py b/pym/client/client_cache.py index 4d22270..2612630 100644 --- a/pym/client/client_cache.py +++ b/pym/client/client_cache.py @@ -284,7 +284,7 @@ class _shareCache(_shareData): return False if not os.path.exists(self.fileName): try: - open(self.fileName, "w") + open(self.fileName, "w").close() except IOError: self.printERROR(_("Failed to create file %s") % self.fileName) return False