parent
f4679693ce
commit
cb4d13327a
@ -1,57 +0,0 @@
|
||||
#-*- coding: utf-8 -*-
|
||||
|
||||
# Copyright 2010 Calculate Ltd. http://www.calculate-linux.org
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
from cl_desktop import install, __app__, __version__
|
||||
from cl_opt import opt
|
||||
import sys
|
||||
from cl_share_cmd import share_cmd
|
||||
|
||||
# Перевод сообщений для программы
|
||||
from cl_lang import lang
|
||||
lang().setLanguage(sys.modules[__name__])
|
||||
|
||||
# Использование программы
|
||||
USAGE = _("%prog [options]")
|
||||
|
||||
# Описание программы (что делает программа)
|
||||
DESCRIPTION = _("Configure the system to calculate-desktop package")
|
||||
|
||||
class install_cmd(share_cmd):
|
||||
def __init__(self):
|
||||
# Объект опций командной строки
|
||||
self.optobj = opt(\
|
||||
package=__app__,
|
||||
version=__version__,
|
||||
usage=USAGE,
|
||||
description=DESCRIPTION,
|
||||
option_list=opt.variable_control+opt.color_control,
|
||||
check_values=self.checkOpts)
|
||||
# Создаем объект логики
|
||||
self.logicObj = install()
|
||||
# Создаем переменные
|
||||
self.logicObj.createClVars()
|
||||
|
||||
def checkOpts(self, optObj, args):
|
||||
"""Проверка опций командной строки"""
|
||||
if args:
|
||||
errMsg = _("invalid argument") + ":" + " %s" %" ".join(args)
|
||||
self.optobj.error(errMsg)
|
||||
return False
|
||||
return optObj, args
|
||||
|
||||
def installProg(self):
|
||||
"""Наложение шаблонов на систему при инсталяции"""
|
||||
return self.logicObj.installProg()
|
@ -1,57 +0,0 @@
|
||||
#-*- coding: utf-8 -*-
|
||||
|
||||
# Copyright 2010 Calculate Ltd. http://www.calculate-linux.org
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
from cl_desktop import uninstall, __app__, __version__
|
||||
from cl_opt import opt
|
||||
import sys
|
||||
from cl_share_cmd import share_cmd
|
||||
|
||||
# Перевод сообщений для программы
|
||||
from cl_lang import lang
|
||||
lang().setLanguage(sys.modules[__name__])
|
||||
|
||||
# Использование программы
|
||||
USAGE = _("%prog [options]")
|
||||
|
||||
# Описание программы (что делает программа)
|
||||
DESCRIPTION = _("Configure the system to calculate-desktop package")
|
||||
|
||||
class uninstall_cmd(share_cmd):
|
||||
def __init__(self):
|
||||
# Объект опций командной строки
|
||||
self.optobj = opt(\
|
||||
package=__app__,
|
||||
version=__version__,
|
||||
usage=USAGE,
|
||||
description=DESCRIPTION,
|
||||
option_list=opt.variable_control+opt.color_control,
|
||||
check_values=self.checkOpts)
|
||||
# Создаем объект логики
|
||||
self.logicObj = uninstall()
|
||||
# Создаем переменные
|
||||
self.logicObj.createClVars()
|
||||
|
||||
def checkOpts(self, optObj, args):
|
||||
"""Проверка опций командной строки"""
|
||||
if args:
|
||||
errMsg = _("invalid argument") + ":" + " %s" %" ".join(args)
|
||||
self.optobj.error(errMsg)
|
||||
return False
|
||||
return optObj, args
|
||||
|
||||
def uninstallProg(self):
|
||||
"""Наложение шаблонов на систему при деинсталяции"""
|
||||
return self.logicObj.uninstallProg()
|
@ -1,52 +0,0 @@
|
||||
#!/usr/bin/python
|
||||
#-*- coding: utf-8 -*-
|
||||
|
||||
# Copyright 2010 Calculate Ltd. http://www.calculate-linux.org
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
import sys
|
||||
import os
|
||||
sys.path.insert(0,os.path.abspath('/usr/lib/calculate-2.2/calculate-lib/pym'))
|
||||
sys.path.insert(0,\
|
||||
os.path.abspath('/usr/lib/calculate-2.2/calculate-desktop/pym'))
|
||||
|
||||
from cl_install_cmd import install_cmd
|
||||
|
||||
from cl_lang import lang
|
||||
tr = lang()
|
||||
tr.setGlobalDomain('cl_desktop')
|
||||
tr.setLanguage(sys.modules[__name__])
|
||||
|
||||
if __name__ == "__main__":
|
||||
obj = install_cmd()
|
||||
ret = obj.optobj.parse_args()
|
||||
if ret is False:
|
||||
sys.exit(1)
|
||||
opts, args = ret
|
||||
# Установка цвета при печати сообщений
|
||||
obj.setPrintNoColor(opts)
|
||||
# Установка переменных
|
||||
if not obj.setVars(opts):
|
||||
sys.exit(1)
|
||||
# Печать переменных
|
||||
obj.printVars(opts)
|
||||
# Если нет печати переменных выполняем логику программы
|
||||
if not opts.v:
|
||||
# Наложение шаблонов на систему при инсталяции
|
||||
if not obj.installProg():
|
||||
sys.exit(1)
|
||||
# Запись переменных
|
||||
if not obj.writeVars(opts):
|
||||
sys.exit(1)
|
||||
sys.exit(0)
|
@ -1,54 +0,0 @@
|
||||
#!/usr/bin/python
|
||||
#-*- coding: utf-8 -*-
|
||||
|
||||
# Copyright 2010 Calculate Ltd. http://www.calculate-linux.org
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
import sys
|
||||
import os
|
||||
sys.path.insert(0,os.path.abspath('/usr/lib/calculate-2.2/calculate-lib/pym'))
|
||||
sys.path.insert(0,\
|
||||
os.path.abspath('/usr/lib/calculate-2.2/calculate-desktop/pym'))
|
||||
|
||||
from cl_uninstall_cmd import uninstall_cmd
|
||||
|
||||
from cl_lang import lang
|
||||
tr = lang()
|
||||
tr.setGlobalDomain('cl_desktop')
|
||||
tr.setLanguage(sys.modules[__name__])
|
||||
|
||||
if __name__ == "__main__":
|
||||
obj = uninstall_cmd()
|
||||
ret = obj.optobj.parse_args()
|
||||
if ret is False:
|
||||
sys.exit(1)
|
||||
opts, args = ret
|
||||
# Установка цвета при печати сообщений
|
||||
obj.setPrintNoColor(opts)
|
||||
# Установка переменных
|
||||
if not obj.setVars(opts):
|
||||
sys.exit(1)
|
||||
# Печать переменных
|
||||
obj.printVars(opts)
|
||||
# Если нет печати переменных выполняем логику программы
|
||||
if not opts.v:
|
||||
# Наложение шаблонов на систему при деинсталяции
|
||||
if not obj.uninstallProg():
|
||||
sys.exit(1)
|
||||
# Запись переменных
|
||||
if not obj.writeVars(opts):
|
||||
sys.exit(1)
|
||||
sys.exit(0)
|
||||
|
||||
|
Loading…
Reference in new issue