parent
b29991c79e
commit
75a3251e5a
@ -0,0 +1,51 @@
|
||||
# Copyright 1999-2012 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
# $Header: $
|
||||
|
||||
EAPI="3"
|
||||
SUPPORT_PYTHON_ABIS="1"
|
||||
PYTHON_DEPEND="2:2.7"
|
||||
RESTRICT_PYTHON_ABIS="2.4 2.5 2.6 3.*"
|
||||
|
||||
inherit distutils eutils
|
||||
|
||||
SRC_URI="ftp://ftp.calculate.ru/pub/calculate/calculate3/${PN}/${P}.tar.bz2"
|
||||
|
||||
DESCRIPTION="The WSDL core for Calculate 3"
|
||||
HOMEPAGE="http://www.calculate-linux.org/main/en/calculate2"
|
||||
LICENSE="Apache-2.0"
|
||||
SLOT="3"
|
||||
KEYWORDS="amd64 x86"
|
||||
IUSE="minimal"
|
||||
|
||||
DEPEND="~sys-apps/calculate-lib-3.2.0_alpha10
|
||||
>=dev-python/soaplib-1.0
|
||||
!minimal? ( dev-python/sudsds
|
||||
net-libs/dslib
|
||||
dev-python/pyopenssl
|
||||
dev-libs/openssl
|
||||
dev-python/m2crypto
|
||||
dev-python/cherrypy )"
|
||||
RDEPEND="${DEPEND}"
|
||||
|
||||
pkg_preinst() {
|
||||
dosym /usr/sbin/cl-core /usr/sbin/cl-core-setup
|
||||
dosym /usr/sbin/cl-core /usr/sbin/cl-core-patch
|
||||
}
|
||||
|
||||
pkg_postinst() {
|
||||
einfo "For autoconfigure calculate-core for adminuser perform:"
|
||||
einfo " cl-core --bootstrap <username>"
|
||||
einfo "For run calculate-core perform:"
|
||||
einfo " /etc/init.d/calculate-core start"
|
||||
einfo "Add calcualte core to autorun:"
|
||||
einfo " rc-update add calculate-core boot"
|
||||
}
|
||||
|
||||
src_unpack() {
|
||||
unpack "${A}"
|
||||
cd "${S}"
|
||||
|
||||
# apply revision changes
|
||||
epatch "${FILESDIR}/calculate-core-3.2.0_alpha10-r9.patch"
|
||||
}
|
@ -0,0 +1,179 @@
|
||||
diff --git core/server/api_types.py core/server/api_types.py
|
||||
index b5d7e76..d9f268c 100644
|
||||
--- core/server/api_types.py
|
||||
+++ core/server/api_types.py
|
||||
@@ -531,8 +531,8 @@ class CoreWsdl:
|
||||
checkall = info.CheckAll
|
||||
errors = map(lambda x:ReturnedMessage(**x),
|
||||
dv.checkGroups(info,allvars=checkall or not checkonly))
|
||||
- if dv.Get('cl_env_debug_set') == 'on':
|
||||
- dv.printGroup(info)
|
||||
+ #if dv.Get('cl_env_debug_set') == 'on':
|
||||
+ # dv.printGroup(info)
|
||||
if errors:
|
||||
return errors
|
||||
if checkonly:
|
||||
diff --git core/server/func.py core/server/func.py
|
||||
index 00249b8..965a387 100644
|
||||
--- core/server/func.py
|
||||
+++ core/server/func.py
|
||||
@@ -20,6 +20,7 @@ import sys, os, re
|
||||
from os import path
|
||||
import traceback
|
||||
from traceback import print_exc
|
||||
+from calculate.lib.cl_log import log
|
||||
from api_types import ReturnProgress,ViewParams,Integer,ViewInfo
|
||||
from loaded_methods import LoadedMethods
|
||||
from calculate.lib.cl_lang import setLocalTranslate,getLazyLocalTranslate
|
||||
@@ -140,7 +141,9 @@ class CommonMethods:
|
||||
# определение каталогов содержащих шаблоны
|
||||
dirs_list, files_list = ([],[])
|
||||
useClt = useClt in ("on",True)
|
||||
- clTempl = ProgressTemplate(self.setProgress,self.clVars,
|
||||
+ self.addProgress()
|
||||
+ nullProgress = lambda *args,**kw:None
|
||||
+ clTempl = ProgressTemplate(nullProgress,self.clVars,
|
||||
cltObj=useClt,
|
||||
cltFilter=cltFilter,
|
||||
printSUCCESS=self.printSUCCESS,
|
||||
@@ -707,9 +710,20 @@ class Action:
|
||||
|
||||
def run(self, objs, dv):
|
||||
"""Запустить список действий"""
|
||||
+ class StubLogger:
|
||||
+ def info(self,s):
|
||||
+ pass
|
||||
result = {}
|
||||
+
|
||||
self.group_name = ""
|
||||
self.clVars = dv
|
||||
+ if dv.Get('cl_env_debug_set') == 'off' or \
|
||||
+ dv.Get('cl_ebuild_phase'):
|
||||
+ logger = StubLogger()
|
||||
+ else:
|
||||
+ logger = log("core-action.log",
|
||||
+ filename="/var/log/calculate/core-action.log",
|
||||
+ formatter="%(asctime)s - %(levelname)s - %(message)s")
|
||||
for obj in objs.values():
|
||||
obj.set_link(self)
|
||||
obj.clVars = dv
|
||||
@@ -717,6 +731,8 @@ class Action:
|
||||
obj.init()
|
||||
try:
|
||||
self.beginFrame()
|
||||
+ logger.info("Start {methodname}".format(
|
||||
+ methodname=self.method_name))
|
||||
for action in self.get_tasks(result):
|
||||
foreach = action.get("foreach","")
|
||||
if foreach:
|
||||
@@ -732,6 +748,15 @@ class Action:
|
||||
task = False
|
||||
try:
|
||||
run_context = self.get_condition_context(action, result)
|
||||
+ actinfo = "Run" if all(run_context.values()) else "Skip"
|
||||
+ logger.info(
|
||||
+ "{action} {name}: condition: {condition}, "
|
||||
+ "depend: {depend}".format(
|
||||
+ action=actinfo,
|
||||
+ name=name,
|
||||
+ condition=run_context['condition'],
|
||||
+ depend=run_context['depend']))
|
||||
+
|
||||
elsePrint, elseMessage = (
|
||||
self.getFormatMessage(action,"else_error",
|
||||
"else_warning","else_message"))
|
||||
@@ -810,6 +835,8 @@ class Action:
|
||||
failedPrint(failedMessage)
|
||||
if task and res in (True,False,"skip"):
|
||||
self.endTask(res)
|
||||
+ logger.info("{name}: Result is {result}".format(
|
||||
+ name=name, result=res))
|
||||
if res is True:
|
||||
on_success = action.get('on_success',None)
|
||||
if on_success:
|
||||
@@ -822,15 +849,19 @@ class Action:
|
||||
self.endTask(False)
|
||||
self.printWARNING(_("Task interrupted"))
|
||||
result["interrupt"] = False
|
||||
+ logger.info("{name}: Interrupeted".format(name=name))
|
||||
except self.native_error as e:
|
||||
if hasattr(e,"addon") and e.addon:
|
||||
self.printERROR(str(e.addon))
|
||||
self.printERROR(str(e))
|
||||
result[name]=False
|
||||
+ logger.info("{name}: Native error".format(name=name))
|
||||
except BaseException as e:
|
||||
result[name]=False
|
||||
error = shortTraceback(*sys.exc_info())
|
||||
self.printERROR("%s:%s"%(name,error))
|
||||
+ logger.info("{name}: Unknown exception {exp}".format(
|
||||
+ name=name, exp=e.__class__.__name__))
|
||||
finally:
|
||||
dv.close()
|
||||
self.endFrame()
|
||||
@@ -1087,7 +1118,7 @@ class CoreWsdl():
|
||||
self.process_dict['counter'] -= 1
|
||||
return res
|
||||
|
||||
- def addProgress(self,message):
|
||||
+ def addProgress(self,message=""):
|
||||
id = random.randint(1, self.Num)
|
||||
while id in self.progress_dict:
|
||||
id = random.randint(1, self.Num)
|
||||
@@ -1240,6 +1271,7 @@ class CoreWsdl():
|
||||
hasattr (com.__class__.__bases__[1], '__init__'):
|
||||
com.__class__.__bases__[1].__init__(com)
|
||||
# start helper
|
||||
+ com.method_name = method_name
|
||||
p = multiprocessing.Process(target = self.target_helper,\
|
||||
args = (com, getattr(com,method)) +(method_name, )+ args_proc)
|
||||
|
||||
diff --git core/server/methods_func.py core/server/methods_func.py
|
||||
index 5a25e4e..fb9565b 100644
|
||||
--- core/server/methods_func.py
|
||||
+++ core/server/methods_func.py
|
||||
@@ -237,7 +237,8 @@ def get_method_argparser(view, args, cl_core = False):
|
||||
# data['metavar'] = field.name.upper()
|
||||
if "choice" in field.type:
|
||||
data['help'] = "%s (%s)" % (
|
||||
- data['help'], _("'list' for display possible values"))
|
||||
+ data['help'],
|
||||
+ _("'list' for displaying possible values"))
|
||||
if field.element in ['check']:
|
||||
data['metavar'] = "ON/OFF"
|
||||
try:
|
||||
@@ -388,7 +389,7 @@ def display_error(error, args, groups):
|
||||
elif error.type != "commonerror":
|
||||
colorPrint.printERROR(params_text % error.message)
|
||||
else:
|
||||
- colorPrint.printWARNING(params_text % error.message)
|
||||
+ colorPrint.printWARNING(error.message)
|
||||
|
||||
|
||||
def check_result_msg(method_result, view, input_error_dict={}, args=None):
|
||||
diff --git core/setup_package.py core/setup_package.py
|
||||
index f920af7..3285b52 100644
|
||||
--- core/setup_package.py
|
||||
+++ core/setup_package.py
|
||||
@@ -113,7 +113,7 @@ class UpdateConfigs(UpdateLogger):
|
||||
"""
|
||||
Получить пользователей в X сессии
|
||||
"""
|
||||
- return self.clVars.Get('desktop.cl_desktop_online_user')
|
||||
+ return list(self.clVars.Get('desktop.cl_desktop_online_user'))+["root"]
|
||||
|
||||
def getConfiguredPasswdUsers(self):
|
||||
"""
|
||||
diff --git core/variables/setup_package.py core/variables/setup_package.py
|
||||
index ac6daf6..9da4e0d 100644
|
||||
--- core/variables/setup_package.py
|
||||
+++ core/variables/setup_package.py
|
||||
@@ -201,7 +201,7 @@ class VariableClCorePkgDesktopSet(Variable):
|
||||
def check(self,value):
|
||||
if self.Get('cl_templates_locate') == ["clt"] and value == "on":
|
||||
raise VariableError(
|
||||
- _("You shouldn't choice only clt location "
|
||||
+ _("You must not choose only clt location "
|
||||
"for desktop templates"))
|
||||
|
||||
def init(self):
|
@ -0,0 +1,26 @@
|
||||
# Copyright 1999-2011 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
# $Header: $
|
||||
|
||||
EAPI=4
|
||||
|
||||
DESCRIPTION="Calculate Utilities meta package"
|
||||
HOMEPAGE="http://www.calculate-linux.org/main/en/calculate2"
|
||||
SRC_URI=""
|
||||
|
||||
LICENSE="Apache-2.0"
|
||||
SLOT="3"
|
||||
KEYWORDS="amd64 x86"
|
||||
IUSE="cl_consolegui cl_client cl_desktop cl_console"
|
||||
|
||||
RDEPEND="${RDEPEND}
|
||||
=sys-apps/calculate-install-3.2.0_alpha10-r3
|
||||
=sys-apps/calculate-i18n-3.2.0_alpha10-r4
|
||||
=sys-apps/calculate-lib-3.2.0_alpha10-r5
|
||||
=sys-apps/calculate-core-3.2.0_alpha10-r9
|
||||
=sys-apps/calculate-update-3.2.0_alpha10-r7
|
||||
cl_client? ( =sys-apps/calculate-client-3.2.0_alpha10-r1 )
|
||||
cl_desktop? ( =sys-apps/calculate-desktop-3.2.0_alpha10 )
|
||||
cl_consolegui? ( =sys-apps/calculate-console-gui-3.2.0_alpha10 )
|
||||
cl_console? ( =sys-apps/calculate-console-3.2.0_alpha10-r1 )
|
||||
"
|
Loading…
Reference in new issue