Да отвечают за создание профиля пользователя два файла (вернее один но код в двух)
/usr/lib64/python2.7/site-packages/calculate/desktop/desktop.py
Кусок кода
def syncSkel(self, ur_home_path, uid, gid):
“”"
Скопировать содержимое /etc/skel в каталог пользователя
“”"
try:
rsync_files(’/etc/skel’, ur_home_path,
opts=(RsyncOptions.Archive,
RsyncOptions.Chown(uid, gid),))
except FilesError as e:
raise DesktopError(str(e))
return True
и
/usr/lib64/python2.7/site-packages/calculate/desktop/utils/cl_desktop.py
Куски кода
def need_skel(Get):
home_path = Get(‘ur_home_path’)
if path.exists(home_path):
files = listDirectory(home_path, onlyDir=True)
if len(files) == 1 and “.calculate” in files:
return True
return False
return True
tasks = [
{‘name’: ‘need_skel’,
‘condition’: need_skel
},
# создать домашниюю директорию
{‘name’: ‘create_home’,
‘message’: __(“Creating the home directory for {ur_login}”),
‘method’: ‘Desktop.createUserDir(ur_login,ur_uid,ur_gid,ur_home_path)’,
‘condition’: lambda dv: not path.exists(dv.Get(‘ur_home_path’))
},
{'name': 'need_skel:sync_skel',
'message': _("Copying skel data"),
'method': 'Desktop.syncSkel(ur_home_path,ur_uid,ur_gid)'
},
# настроить пользовательских профиль шаблонами
{'name': 'user_profile',
'message': __("Setting up the user profile"),
'method': 'Desktop.applyTemplates(None,False,'
'False,None)',
'condition': lambda Get: (Get('cl_desktop_force_setup_set') == 'on' or
Get('cl_desktop_update_profile_set') == 'on')
},