From ca3a0d993fb187e1af0b5445f89c44821f85b571 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A1=D0=B0=D0=BC=D0=BE=D1=83=D0=BA=D0=B8=D0=BD=20=D0=90?= =?UTF-8?q?=D0=BB=D0=B5=D0=BA=D1=81=D0=B5=D0=B9?= Date: Thu, 10 Jun 2010 09:18:25 +0400 Subject: [PATCH] Renamed templates path --- setup.py | 25 +++++++++++-------- {client => templates}/.calculate_directory | 0 .../domain/.calculate_directory | 0 .../domain/gdm/.calculate_directory | 0 .../domain/gdm/Init/.calculate_directory | 0 .../domain/gdm/Init/00Default | 0 .../domain/gdm/Init/05Default | 0 {client => templates}/domain/gdm/custom.conf | 0 .../domain/glibc/.calculate_directory | 0 .../domain/glibc/nsswitch.conf | 0 .../domain/kdm/.calculate_directory | 0 {client => templates}/domain/kdm/kdmrc | 0 .../domain/nss_ldap/.calculate_directory | 0 .../domain/nss_ldap/ldap.conf | 0 .../domain/openssh/.calculate_directory | 0 .../domain/openssh/ssh_config | 0 .../domain/pambase/.calculate_directory | 0 .../domain/pambase/system-auth | 0 .../domain/xfdesktop/.calculate_directory | 0 .../domain/xfdesktop/kioskrc | 0 .../undomain/.calculate_directory | 0 .../undomain/gdm/.calculate_directory | 0 .../undomain/gdm/Init/.calculate_directory | 0 .../undomain/gdm/Init/00Default | 0 .../undomain/gdm/Init/05Default | 0 .../undomain/gdm/custom.conf | 0 .../undomain/glibs/.calculate_directory | 0 .../undomain/glibs/nsswitch.conf | 0 .../undomain/kdm/.calculate_directory | 0 {client => templates}/undomain/kdm/kdmrc | 0 .../undomain/nss_ldap/.calculate_directory | 0 .../undomain/nss_ldap/ldap.conf | 0 .../undomain/openssh/.calculate_directory | 0 .../undomain/openssh/ssh_config | 0 .../undomain/pambase/.calculate_directory | 0 .../undomain/pambase/system-auth | 0 .../undomain/xfdesktop/.calculate_directory | 0 .../undomain/xfdesktop/kioskrc | 0 38 files changed, 14 insertions(+), 11 deletions(-) rename {client => templates}/.calculate_directory (100%) rename {client => templates}/domain/.calculate_directory (100%) rename {client => templates}/domain/gdm/.calculate_directory (100%) rename {client => templates}/domain/gdm/Init/.calculate_directory (100%) rename {client => templates}/domain/gdm/Init/00Default (100%) rename {client => templates}/domain/gdm/Init/05Default (100%) rename {client => templates}/domain/gdm/custom.conf (100%) rename {client => templates}/domain/glibc/.calculate_directory (100%) rename {client => templates}/domain/glibc/nsswitch.conf (100%) rename {client => templates}/domain/kdm/.calculate_directory (100%) rename {client => templates}/domain/kdm/kdmrc (100%) rename {client => templates}/domain/nss_ldap/.calculate_directory (100%) rename {client => templates}/domain/nss_ldap/ldap.conf (100%) rename {client => templates}/domain/openssh/.calculate_directory (100%) rename {client => templates}/domain/openssh/ssh_config (100%) rename {client => templates}/domain/pambase/.calculate_directory (100%) rename {client => templates}/domain/pambase/system-auth (100%) rename {client => templates}/domain/xfdesktop/.calculate_directory (100%) rename {client => templates}/domain/xfdesktop/kioskrc (100%) rename {client => templates}/undomain/.calculate_directory (100%) rename {client => templates}/undomain/gdm/.calculate_directory (100%) rename {client => templates}/undomain/gdm/Init/.calculate_directory (100%) rename {client => templates}/undomain/gdm/Init/00Default (100%) rename {client => templates}/undomain/gdm/Init/05Default (100%) rename {client => templates}/undomain/gdm/custom.conf (100%) rename {client => templates}/undomain/glibs/.calculate_directory (100%) rename {client => templates}/undomain/glibs/nsswitch.conf (100%) rename {client => templates}/undomain/kdm/.calculate_directory (100%) rename {client => templates}/undomain/kdm/kdmrc (100%) rename {client => templates}/undomain/nss_ldap/.calculate_directory (100%) rename {client => templates}/undomain/nss_ldap/ldap.conf (100%) rename {client => templates}/undomain/openssh/.calculate_directory (100%) rename {client => templates}/undomain/openssh/ssh_config (100%) rename {client => templates}/undomain/pambase/.calculate_directory (100%) rename {client => templates}/undomain/pambase/system-auth (100%) rename {client => templates}/undomain/xfdesktop/.calculate_directory (100%) rename {client => templates}/undomain/xfdesktop/kioskrc (100%) diff --git a/setup.py b/setup.py index cefcec0..1b885e2 100755 --- a/setup.py +++ b/setup.py @@ -33,13 +33,13 @@ data_files = [] var_data_files = [] -data_dirs_template = ['client'] +data_dirs_template = ['templates'] data_dirs_share = ['i18n'] -share_calculate_dir = "/usr/share/calculate-2.2/" +share_calculate_dir = "/usr/share/calculate-2.2" template_calculate_dir = os.path.join(share_calculate_dir, "templates") +template_replace_dirname = "client" - -def __scanDir(scanDir, prefix, dirData, flagDir=False): +def __scanDir(scanDir, prefix, replace_dirname, dirData, flagDir=False): """Scan directory""" files = [] dirs = [] @@ -51,31 +51,34 @@ def __scanDir(scanDir, prefix, dirData, flagDir=False): files.append(absPath) elif stat.S_ISDIR(statInfo): dirs.append(absPath) + if replace_dirname: + listDirs = list(scanDir.partition("/"))[1:] + listDirs.insert(0,replace_dirname) + scanDir = "".join(listDirs) if prefix: scanDir = os.path.join(prefix,scanDir) dirData.append((scanDir, files)) for sDir in dirs: - __scanDir(sDir, prefix, dirData, True) + __scanDir(sDir, prefix, replace_dirname, dirData, True) return dirData -def create_data_files(data_dirs, prefix=""): +def create_data_files(data_dirs, prefix="", replace_dirname=""): """Create data_files""" data_files = [] for data_dir in data_dirs: data = [] - data_files += __scanDir(data_dir, prefix, data) + data_files += __scanDir(data_dir, prefix, replace_dirname, data) return data_files - -data_files += create_data_files (data_dirs_template, template_calculate_dir) +data_files += create_data_files (data_dirs_template, template_calculate_dir, + template_replace_dirname) data_files += create_data_files (data_dirs_share, share_calculate_dir) data_files += [('/etc/init.d', ['data/client'])] data_files += [('/usr/share/calculate-2.2/xdm/login.d', ['data/login.d/10client'])] +\ [('/usr/share/calculate-2.2/xdm/logout.d', ['data/logout.d/10client'])] +\ - [('/usr/share/calculate-2.2/xdm/', - ['data/wait_domain'])] +\ + [('/usr/share/calculate-2.2/xdm/',['data/wait_domain'])] +\ [('/var/calculate/templates', [])] diff --git a/client/.calculate_directory b/templates/.calculate_directory similarity index 100% rename from client/.calculate_directory rename to templates/.calculate_directory diff --git a/client/domain/.calculate_directory b/templates/domain/.calculate_directory similarity index 100% rename from client/domain/.calculate_directory rename to templates/domain/.calculate_directory diff --git a/client/domain/gdm/.calculate_directory b/templates/domain/gdm/.calculate_directory similarity index 100% rename from client/domain/gdm/.calculate_directory rename to templates/domain/gdm/.calculate_directory diff --git a/client/domain/gdm/Init/.calculate_directory b/templates/domain/gdm/Init/.calculate_directory similarity index 100% rename from client/domain/gdm/Init/.calculate_directory rename to templates/domain/gdm/Init/.calculate_directory diff --git a/client/domain/gdm/Init/00Default b/templates/domain/gdm/Init/00Default similarity index 100% rename from client/domain/gdm/Init/00Default rename to templates/domain/gdm/Init/00Default diff --git a/client/domain/gdm/Init/05Default b/templates/domain/gdm/Init/05Default similarity index 100% rename from client/domain/gdm/Init/05Default rename to templates/domain/gdm/Init/05Default diff --git a/client/domain/gdm/custom.conf b/templates/domain/gdm/custom.conf similarity index 100% rename from client/domain/gdm/custom.conf rename to templates/domain/gdm/custom.conf diff --git a/client/domain/glibc/.calculate_directory b/templates/domain/glibc/.calculate_directory similarity index 100% rename from client/domain/glibc/.calculate_directory rename to templates/domain/glibc/.calculate_directory diff --git a/client/domain/glibc/nsswitch.conf b/templates/domain/glibc/nsswitch.conf similarity index 100% rename from client/domain/glibc/nsswitch.conf rename to templates/domain/glibc/nsswitch.conf diff --git a/client/domain/kdm/.calculate_directory b/templates/domain/kdm/.calculate_directory similarity index 100% rename from client/domain/kdm/.calculate_directory rename to templates/domain/kdm/.calculate_directory diff --git a/client/domain/kdm/kdmrc b/templates/domain/kdm/kdmrc similarity index 100% rename from client/domain/kdm/kdmrc rename to templates/domain/kdm/kdmrc diff --git a/client/domain/nss_ldap/.calculate_directory b/templates/domain/nss_ldap/.calculate_directory similarity index 100% rename from client/domain/nss_ldap/.calculate_directory rename to templates/domain/nss_ldap/.calculate_directory diff --git a/client/domain/nss_ldap/ldap.conf b/templates/domain/nss_ldap/ldap.conf similarity index 100% rename from client/domain/nss_ldap/ldap.conf rename to templates/domain/nss_ldap/ldap.conf diff --git a/client/domain/openssh/.calculate_directory b/templates/domain/openssh/.calculate_directory similarity index 100% rename from client/domain/openssh/.calculate_directory rename to templates/domain/openssh/.calculate_directory diff --git a/client/domain/openssh/ssh_config b/templates/domain/openssh/ssh_config similarity index 100% rename from client/domain/openssh/ssh_config rename to templates/domain/openssh/ssh_config diff --git a/client/domain/pambase/.calculate_directory b/templates/domain/pambase/.calculate_directory similarity index 100% rename from client/domain/pambase/.calculate_directory rename to templates/domain/pambase/.calculate_directory diff --git a/client/domain/pambase/system-auth b/templates/domain/pambase/system-auth similarity index 100% rename from client/domain/pambase/system-auth rename to templates/domain/pambase/system-auth diff --git a/client/domain/xfdesktop/.calculate_directory b/templates/domain/xfdesktop/.calculate_directory similarity index 100% rename from client/domain/xfdesktop/.calculate_directory rename to templates/domain/xfdesktop/.calculate_directory diff --git a/client/domain/xfdesktop/kioskrc b/templates/domain/xfdesktop/kioskrc similarity index 100% rename from client/domain/xfdesktop/kioskrc rename to templates/domain/xfdesktop/kioskrc diff --git a/client/undomain/.calculate_directory b/templates/undomain/.calculate_directory similarity index 100% rename from client/undomain/.calculate_directory rename to templates/undomain/.calculate_directory diff --git a/client/undomain/gdm/.calculate_directory b/templates/undomain/gdm/.calculate_directory similarity index 100% rename from client/undomain/gdm/.calculate_directory rename to templates/undomain/gdm/.calculate_directory diff --git a/client/undomain/gdm/Init/.calculate_directory b/templates/undomain/gdm/Init/.calculate_directory similarity index 100% rename from client/undomain/gdm/Init/.calculate_directory rename to templates/undomain/gdm/Init/.calculate_directory diff --git a/client/undomain/gdm/Init/00Default b/templates/undomain/gdm/Init/00Default similarity index 100% rename from client/undomain/gdm/Init/00Default rename to templates/undomain/gdm/Init/00Default diff --git a/client/undomain/gdm/Init/05Default b/templates/undomain/gdm/Init/05Default similarity index 100% rename from client/undomain/gdm/Init/05Default rename to templates/undomain/gdm/Init/05Default diff --git a/client/undomain/gdm/custom.conf b/templates/undomain/gdm/custom.conf similarity index 100% rename from client/undomain/gdm/custom.conf rename to templates/undomain/gdm/custom.conf diff --git a/client/undomain/glibs/.calculate_directory b/templates/undomain/glibs/.calculate_directory similarity index 100% rename from client/undomain/glibs/.calculate_directory rename to templates/undomain/glibs/.calculate_directory diff --git a/client/undomain/glibs/nsswitch.conf b/templates/undomain/glibs/nsswitch.conf similarity index 100% rename from client/undomain/glibs/nsswitch.conf rename to templates/undomain/glibs/nsswitch.conf diff --git a/client/undomain/kdm/.calculate_directory b/templates/undomain/kdm/.calculate_directory similarity index 100% rename from client/undomain/kdm/.calculate_directory rename to templates/undomain/kdm/.calculate_directory diff --git a/client/undomain/kdm/kdmrc b/templates/undomain/kdm/kdmrc similarity index 100% rename from client/undomain/kdm/kdmrc rename to templates/undomain/kdm/kdmrc diff --git a/client/undomain/nss_ldap/.calculate_directory b/templates/undomain/nss_ldap/.calculate_directory similarity index 100% rename from client/undomain/nss_ldap/.calculate_directory rename to templates/undomain/nss_ldap/.calculate_directory diff --git a/client/undomain/nss_ldap/ldap.conf b/templates/undomain/nss_ldap/ldap.conf similarity index 100% rename from client/undomain/nss_ldap/ldap.conf rename to templates/undomain/nss_ldap/ldap.conf diff --git a/client/undomain/openssh/.calculate_directory b/templates/undomain/openssh/.calculate_directory similarity index 100% rename from client/undomain/openssh/.calculate_directory rename to templates/undomain/openssh/.calculate_directory diff --git a/client/undomain/openssh/ssh_config b/templates/undomain/openssh/ssh_config similarity index 100% rename from client/undomain/openssh/ssh_config rename to templates/undomain/openssh/ssh_config diff --git a/client/undomain/pambase/.calculate_directory b/templates/undomain/pambase/.calculate_directory similarity index 100% rename from client/undomain/pambase/.calculate_directory rename to templates/undomain/pambase/.calculate_directory diff --git a/client/undomain/pambase/system-auth b/templates/undomain/pambase/system-auth similarity index 100% rename from client/undomain/pambase/system-auth rename to templates/undomain/pambase/system-auth diff --git a/client/undomain/xfdesktop/.calculate_directory b/templates/undomain/xfdesktop/.calculate_directory similarity index 100% rename from client/undomain/xfdesktop/.calculate_directory rename to templates/undomain/xfdesktop/.calculate_directory diff --git a/client/undomain/xfdesktop/kioskrc b/templates/undomain/xfdesktop/kioskrc similarity index 100% rename from client/undomain/xfdesktop/kioskrc rename to templates/undomain/xfdesktop/kioskrc