From f2b62372467d9dc1d6e7e9169cce0e90a466a6ca Mon Sep 17 00:00:00 2001 From: root Date: Wed, 8 Feb 2023 18:12:30 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D0=B8=D0=B5=20=D0=B2=D0=BE=D0=B7=D0=BC=D0=BE=D0=B6=D0=BD?= =?UTF-8?q?=D0=BE=D1=81=D1=82=D0=B8=20=D1=83=D0=BA=D0=B0=D0=B7=D1=8B=D0=B2?= =?UTF-8?q?=D0=B0=D1=82=D1=8C=20=D0=B4=D0=BE=D0=BF=D0=BE=D0=BB=D0=BD=D0=B8?= =?UTF-8?q?=D1=82=D0=B5=D0=BB=D1=8C=D0=BD=D1=8B=D0=B5=20=D1=82=D0=BE=D1=87?= =?UTF-8?q?=D0=BA=D0=B8=20=D0=BC=D0=BE=D0=BD=D1=82=D0=B8=D1=80=D0=BE=D0=B2?= =?UTF-8?q?=D0=B0=D0=BD=D0=B8=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pym/client/variables/client.py | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/pym/client/variables/client.py b/pym/client/variables/client.py index 8a5cb0e..d8ff851 100644 --- a/pym/client/variables/client.py +++ b/pym/client/variables/client.py @@ -479,6 +479,15 @@ class VariableClClientUserMountData(ReadonlyTableVariable): samba_host = self.Get('sr_samba_host') ftp_host = convertEnv().getVar("ftp", "host") + def map_names(name): + name_dct = {'domain.dmz': 'Санкт-Петербург', 'domain.spb': 'Санкт-Петербург', + 'domain.msk': 'Москва', 'domain.verevo': 'Производство'} + for i in name_dct: + if i in name: + return name_dct[i] + else: + return 'error' + def generate(): yield ( "share", "share", path.join(self.Get('ur_home_path'), "Share"), @@ -502,6 +511,15 @@ class VariableClClientUserMountData(ReadonlyTableVariable): self.Get('cl_replication_host')) else: yield ("remote_profile", 'unix', '', '') + try: + for host, mount_path in zip(self.Get('cl_share_hosts'), self.Get('cl_share_mounts')): + resource = host.split('/')[-1] + host = host.replace('//', '', 1).split(f"/{resource}")[0] + if mount_path.startswith('~/'): + mount_path = f"{path.join(self.Get('ur_home_path'), mount_path.replace('~/', '', 1))}" + yield (resource, resource, mount_path, host) + except: + raise GeneratorExit return list(generate()) @@ -551,6 +569,16 @@ class VariableClClientUserMountHost(FieldValue, ReadonlyVariable): column = 3 +class VariableClShareHosts(Variable): + type = "list" + value = [] + + +class VariableClShareMounts(Variable): + type = "list" + value = [] + + class SyncHelper(): """ Вспомогательный объект для определения статуса синхронизации и времени