|
|
|
@ -45,6 +45,34 @@ imp_cl_help = cl_utils2.cl_help
|
|
|
|
|
# Форматированный вывод
|
|
|
|
|
imp_cl_smcon = cl_utils2.cl_smartcon
|
|
|
|
|
|
|
|
|
|
class newClass:
|
|
|
|
|
"""Класс для создания новых классов"""
|
|
|
|
|
def createNewClass(self, name, bases, attrs={}):
|
|
|
|
|
"""Создает объект нового класса
|
|
|
|
|
|
|
|
|
|
createNewClass(self, name, bases, attrs)
|
|
|
|
|
name - имя класса - str,
|
|
|
|
|
bases - cписок наследуемых классов - (tuple),
|
|
|
|
|
attrs - аттрибуты класса - {dict}
|
|
|
|
|
"""
|
|
|
|
|
class newMethod:
|
|
|
|
|
#Объединяем конфигурации
|
|
|
|
|
def join(self, newObj):
|
|
|
|
|
if newObj.__class__.__name__ == self.__class__.__name__:
|
|
|
|
|
self.docObj.joinDoc(newObj.doc)
|
|
|
|
|
attrsNew = {}
|
|
|
|
|
attrsNew["configName"] = name
|
|
|
|
|
if attrs:
|
|
|
|
|
for key in attrs.keys():
|
|
|
|
|
attrsNew[key] = attrs[key]
|
|
|
|
|
newCl = type(name, bases + (newMethod, object,), attrsNew)
|
|
|
|
|
return newCl
|
|
|
|
|
|
|
|
|
|
class printNoColor:
|
|
|
|
|
def colorPrint(self,attr,fg,bg,string):
|
|
|
|
|
sys.stdout.write(string)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class cl_client(imp_cl_err, imp_cl_xml, imp_cl_help, imp_cl_smcon):
|
|
|
|
|
"""Основной класс для работы с LDAP"""
|
|
|
|
|
def __init__(self, cmdName):
|
|
|
|
@ -154,6 +182,13 @@ class cl_client(imp_cl_err, imp_cl_xml, imp_cl_help, imp_cl_smcon):
|
|
|
|
|
'helpChapter':_("Common options"),
|
|
|
|
|
'help':_("print variables (TYPE_VAR - all:full var)")
|
|
|
|
|
},
|
|
|
|
|
{'progAccess':(0,1,2),
|
|
|
|
|
'longOption':"color",
|
|
|
|
|
'optVal':_("WHEN"),
|
|
|
|
|
'helpChapter':_("Common options"),
|
|
|
|
|
'help':_("control whether color is used to distinguish file types. \
|
|
|
|
|
WHEN may be 'never', 'always', or 'auto'")
|
|
|
|
|
},
|
|
|
|
|
{'progAccess':(0,),
|
|
|
|
|
'longOption':"mount",
|
|
|
|
|
'helpChapter':_("Common options"),
|
|
|
|
|