Добавлено выполнение произвольных действий в утилиты 3.1.7

atratsevskiy
Mike khiretskiy 11 years ago
parent ede3225e86
commit 36a74b79af

@ -10,6 +10,8 @@ AUX calculate-core-3.1.7-r3.patch 2433 SHA256 5faaf6d9645dd864f22d1337e2b29bbefa
AUX calculate-core-3.1.7-r4.patch 3538 SHA256 af83b8abb18e6d8f6d27dcaac950846a38026e8b39d78c3f360d345446aa7c96 SHA512 80f1ce0bac6c03892d3707a981b3b577b9df185d6d4e0328db229cbb617137aa5689c8343a742e999b61038fbf07a65641a682d9475a9aa57ad10123bbaab31b WHIRLPOOL 5d5f75dd5bf8a3d244b67142d61fc38bee1dbfc52f617d15fcc36d921d5f04005b95d7f5862927e01b52ecafadbeeb91b97f054d7d7ec09c363028a7ccd52118
AUX calculate-core-3.1.7-r5.patch 5358 SHA256 99c1a435a1525567d2a3dd0a1e8c564eb030a765431a15a8486483581d2dbb07 SHA512 95a061a6b51cdf0083b8f736c337b24abacfa9c119f8080b2de953eb4b64a7490e7387ad10f412e5fdf0b8272dbcbd80bc080b2760c1386df50ba1d44f723ce4 WHIRLPOOL 289e91784146d2cd01ca8dc0ae449e078c56c5e327e1a6f86b8f28ac5f2eea88b06942a5f8f0132200f9fb1fc234c75903a015a2e0a7ea35b3c93e88471cceb0
AUX calculate-core-3.1.7-r6.patch 5569 SHA256 5a160d36459405c04b95262ce0842f69af4447e10b1dbef037791394edfcc728 SHA512 4525e4f8d3e234064b0f385f983c6e095fe6f791535eeeb921375551368625ca60724332872376bb52c187147d0fc3ce863652ba9e6d1281cd59e34194ac86aa WHIRLPOOL 8173ed90e1dc0427cbb288c5d505b92fdcad33ec6da018d75a8cfca3f1eb3e95d1d48ac95808f0f2efd6240847598ba13f377ff91c76e598bd4fea464ea66bfd
AUX calculate-core-3.1.7-r7.patch 14793 SHA256 e01eb7093bea469f2fc6bb1685c2249aec5d1a4441ada5a8150b8279aa667296 SHA512 11c4db481ee9c48b5b63ca14e65c633716e0561bdc0eeda7adffae9874492d0b2664fd9d5ae18f7c92efeb5c282f2971ff79bf8533b8dbd7471e59f2ed595e97 WHIRLPOOL d93333638cfae66e86ca150ea5e966cf415e47237bcae1bb20224982cf37354d7a8846875eb6decc6978566232ce07654ec7920acb4fa43f12366feb35cb1d02
AUX calculate-core-3.1.7-r8.patch 12265 SHA256 154c6c09231d93563a1ff5038cc5d14d2b102774dfafea228af11f4df9a52b91 SHA512 3386e05e756e26258d5a0f153cdaa3a5f376047c44b7c3f96a478cf81a07ebbc123190c60a129c9a8aea7b80bf64b840abd1c7f648fc9134abc80dc86dc5aebc WHIRLPOOL 8b034ede6b6112a8c635f7d37cdfc0d20c3c66cab4a3f018d86896d1b2932c7a8d497506bfa2c64bd45aa8459e2fb2d2e7a498c75990054e4653c6fb66044a4f
DIST calculate-core-3.1.5.tar.bz2 85114 SHA256 afee468462f6e838e2f165cacf675f7134f48302e0a7d74e9f910093ee1ec25d SHA512 c3218116abd4fc1e864df1abcad2959042f67eb1847ddce6b28237bebbd354a10720562c96820ea7ba22488630ee7c5abb1a8507cb1ddf88019d8a50007c6a0b WHIRLPOOL cc605fe5d9a50a210f97462f8c059efbf40984d17f1d18ecbf432ba2fcfc3112d034a09bfc43de3b0983d1c742735182870f48626f7897b8f36c522491af4fac
DIST calculate-core-3.1.6.tar.bz2 85099 SHA256 d582745a4b211202587cc8eda828bac8d69d5cf533e71ff51e0f3b27b15571a5 SHA512 63f9503be189af52cdcf917ab95841fa7030d181e25ff3910dba68ee0289590867ce1fe865a7c4dba778809ee43311067d4671330e8c5788397c83e162cd54e4 WHIRLPOOL ca9556855388168eb1b2b6cd4e4c7c8c879ac21cd79bede8ca6b2d765e57a52841ad1ac165bdbb9b99a8130942fa2b712bf7f09bb25e9941993225061bce97ab
DIST calculate-core-3.1.7.tar.bz2 83298 SHA256 3ecda86e199fe360362de9a43c9a0a53250512c430c8f5da42c611dc9f932f86 SHA512 fc197cc253ea4ad15e5010b894c516d07745155b78ea7d365eeb656dc680b0d2815596bb9de2d8c9e95dd9da27d10205651f8d199e9ec5a8fbaf410167f39a11 WHIRLPOOL e8b8b2f1031919e3d2832bce12b23b7cceae8216aa95c39f571afb88afdf745546d0afa4d6588f8236b772c04bde0babbf8ce6e1b6be996eac035328b307f86b
@ -23,6 +25,8 @@ EBUILD calculate-core-3.1.7-r3.ebuild 1257 SHA256 a1f9438879f5a1d98c315edf27a105
EBUILD calculate-core-3.1.7-r4.ebuild 1257 SHA256 bb3ef11815ab41231aaafa9231a24be5e9f8655ceaed371a3abd0ac47256304c SHA512 872c29932cb8103c8d06bbc575365648704781c916c67dd49f298ccb723f7eeec618849af8b3cb79c8fed0f84997972c77b43d6ff89fa3dcad8dcf70ba0b85c4 WHIRLPOOL b822f0d1fdc0c24d88d0f5b2d7387aa083bb150ba36af8aa507ffe460c4e7e2ea63d08bb1cdfb67ad1b1746710406a64ce29a272fd3d099620e70de17ab982eb
EBUILD calculate-core-3.1.7-r5.ebuild 1257 SHA256 1adb9c6dc37f276d74e8b60bcae16fc7837dc14aeec994e72c10e369fc9ec950 SHA512 1ab42c6aff2fe1e282b92109146e948350b3d4eea22432df165adba99743afca317bb9c931621de08ad87d8de39e0ef2266004e5b6d52c38a1f588865bc53707 WHIRLPOOL 6f400f190bb49042b1080db487660df525dbe19ee1a8d66bf4484822defc1d0d1ebeeaff30a61f1915474dce4530c73300a9d90efc9f547095ec5e173aa62af2
EBUILD calculate-core-3.1.7-r6.ebuild 1257 SHA256 60fb50b296af705679aef860a39a8fc400334ec1cde5fd56e3585160c19e2d87 SHA512 563185557b43757ee07d7f586bf686c4201043a2ae9b2e6d54769d4fb15c2f41ea4a770309da1951152af072583808495a890798373e2a8659060ee9c5a75d7f WHIRLPOOL 5af50f7d7477e0ce5d0d173699d33c243171e224a61d75040d34ada202c79a1152e5553481d58798dc7809576309f51628e4245eacb3bd4fd0ebf3a47c67b40c
EBUILD calculate-core-3.1.7-r7.ebuild 1257 SHA256 3e94ddb154fcaa3c27ad05b85ed82b1c3f599940f13d378c074d098b163a6ca0 SHA512 574a9c3751cfaf74857bcfbf33e9b8e4f2e10c35f8e6a35ddd90b8deee482f4e248aeeb49e6d70f78a6758bbd8883eb3916a3ad44430cd15143a64bad49c78ec WHIRLPOOL 333b7947a993f7acc330f96903d93ba5a62378423df5d5d65e908317804ec1b429e8184ecc12dd176f04353f270c7843650dfc53e974c635cd6cfe559b2a0cdc
EBUILD calculate-core-3.1.7-r8.ebuild 1257 SHA256 d74ce322e3d7528e5478ddc2aa79b223f31c682ba1fc3f1c2d04869448a201c2 SHA512 b9c33bdd1c8821ee6230eb3fe0921764c6297054d911ace9ac50a633e1a9410dc29a6cf9748280cb6fca6528e90d6c718e365ed383b04a803f2c84b170743641 WHIRLPOOL 4584c5d45c869327e514d00965f0ae27a5986f9a44b872a6e1d1f8efd5c78c6b04d178b7ee4f29b22395f15962aba2a0b5bdb48ee9aad4cbcafd8def698e42e7
EBUILD calculate-core-3.1.7.ebuild 1122 SHA256 b1273517f9e91b41e2b0ed784e3e16d259486ea68db3612b49d96c557c0005a9 SHA512 55ab3996f0c69f9240a3c6b09ff2a28929b8f814b4f23dcc5ac3d0fc23e914f782eac61979a3eee6a56ae718fa8e3fa94a4e3775b2719756ac6278c4fdfa41fe WHIRLPOOL 5f114887f6a3ccb4bc684603a30f48dfcc501d2054fd290011bb849757e5cbb2ee667eabc5d7cf228f16af468e1ec55df1dbc67208e8169188e6f3121a945e7b
EBUILD calculate-core-3.1.7_alpha3.ebuild 1120 SHA256 159f295c2aa1ec1d15bc9c8f3cba33a6c5d86272af4f1c7a91de84541cd4bafa SHA512 271430ec591da7aba0a1c39f60b2198b06a2dbbe6afe0a4b3ec3bd0d98fce63c4ea5f6ef1a26bc1046ad6aa6752cc9d7d203cf196b0da485dfb17d710c2e0b72 WHIRLPOOL fa06221b99e50b8aa5a5ebc1db4d14aa1ddae7a4d9e49fe4cfa3a51cf5c38ea9a5fb845bdd2f47efcc6552cde686c08803b35c3069687354bfb68ad35bda7edb
EBUILD calculate-core-3.1.9999.ebuild 656 SHA256 475e34d10141354a4c60e029fc1cb74b080c3a1371d9e1e44a5e2936b7130ed4 SHA512 9ba865c5effa56079a3841a96d1a4a89d4bbc27e092042aa4a87d1b4ecde9d3a690c92c73e10b330724258aaf3138d2a58d50d18d2fbea9e657c3c5d2f8395ee WHIRLPOOL 89d3bcc657324d1ffb4265eab3e28e94e3d00fb7530c6654e75b52fe002d70f72998930729cfe3320a3ff571277e6e59c649b0df2fe071bcd9b050f9d42608eb

@ -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.1.7
>=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.1.7-r7.patch"
}

@ -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.1.7
>=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.1.7-r8.patch"
}

@ -0,0 +1,365 @@
diff --git core/server/api_types.py core/server/api_types.py
index 8161a9e..0bca760 100644
--- core/server/api_types.py
+++ core/server/api_types.py
@@ -359,7 +359,7 @@ class ViewInfo(DataVarsSerializer):
varGroups = datavars.getGroups()
lastGroup = len(varGroups)-1
# interate all vars group
- if not onlyhelp and (step in(0,-1,None) or allsteps):
+ if step in(0,-1,None) or allsteps:
briefData = datavars.getBrief()
self.groups.append(self.stepGroup(varGroups,brief_label,
help_value=briefData.get("help",None),
diff --git core/server/func.py core/server/func.py
index fdee9d5..be7c323 100644
--- core/server/func.py
+++ core/server/func.py
@@ -1659,7 +1659,7 @@ class WsdlBase:
def clearDataVars(func):
def wrapper(*args,**kwargs):
try:
- func(*args,**kwargs)
+ return func(*args,**kwargs)
finally:
WsdlMeta.closeDataVars()
return wrapper
diff --git core/server/methods_func.py core/server/methods_func.py
index d546c1f..72014a2 100644
--- core/server/methods_func.py
+++ core/server/methods_func.py
@@ -501,10 +501,10 @@ def collect_object(client, param_object, view, args,wait_thread = None,
val)
elif field.element in ['input', 'openfile',\
- 'file', 'radio']:
+ 'file', 'radio','combo','comboEdit']:
param_object = set_obj_item(client, param_object, field.name,
_getattr(args, field.name))
- elif field.element in ['password'] and _getattr(args, field.name) \
+ elif 'passwd' in field.element and _getattr(args, field.name) \
or field.type and "need" in field.type:
if wait_thread:
wait_thread.pause()
@@ -517,21 +517,6 @@ def collect_object(client, param_object, view, args,wait_thread = None,
password)
if wait_thread:
wait_thread.resume()
- elif field.element in ['combo', 'comboEdit']:
- value = _getattr(args, field.name)
- if value:
- if hasattr (field.choice, 'string'):
- choice = field.choice.string
- else:
- choice = field.choice
- for item in choice:
- if item:
- if value.lower() == item.lower():
- value = item
- break
-
- param_object = set_obj_item(client, param_object, field.name,
- value)
elif field.element in ['multichoice', 'multichoice_add', \
'selecttable', 'selecttable_add']:
val = _getattr(args, field.name)
diff --git core/server/replace_class.py core/server/replace_class.py
index 860ede2..02ea194 100644
--- core/server/replace_class.py
+++ core/server/replace_class.py
@@ -515,7 +515,7 @@ def call_method(metaObject, args, unknown_args, colorPrint):
view_obj.step = None
view_obj.expert = True
view_obj.brief = None
- view_obj.onlyhelp = False
+ view_obj.onlyhelp = True
try:
view = getattr(metaObject, method_view_name)(0, view_obj)
diff --git core/utils/cl_core_custom.py core/utils/cl_core_custom.py
new file mode 100644
index 0000000..518f4cd
--- /dev/null
+++ core/utils/cl_core_custom.py
@@ -0,0 +1,56 @@
+#-*- coding: utf-8 -*-
+
+# Copyright 2013 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
+from calculate.core.server.func import Action,Tasks
+from calculate.lib.cl_lang import setLocalTranslate,getLazyLocalTranslate
+from calculate.lib.datavars import VariableError
+from calculate.lib.cl_template import TemplatesError
+from calculate.lib.utils.files import FilesError
+
+setLocalTranslate('cl_install3',sys.modules[__name__])
+__ = getLazyLocalTranslate(_)
+
+class ClCoreCustomAction(Action):
+ """
+ Действие для настройки параметров видео
+ """
+ # ошибки, которые отображаются без подробностей
+ native_error = (FilesError, TemplatesError,VariableError)
+
+ successMessage = __("Custom action successfully completed!")
+ failedMessage = __("Failed to perform custom action!")
+ interruptMessage = __("Custom action manually interrupted")
+
+ def __init__(self):
+ # список задач для дейсвия
+ self.tasks = [
+ {'name':'apply_templates',
+ # наложить шаблоны на текущий дистрибутив, включая clt шаблоны
+ # без использования фильтров по clt шаблонам
+ 'method':'UpdateConfigs.applyTemplates(None,False,'\
+ 'None,None)',
+ },
+ {'name':'failed_action',
+ 'error':__("Action {ac_custom_name} not found"),
+ 'condition':lambda Get:not filter(
+ lambda x:x and x[0] == 'ac_custom_name' and \
+ x[1] == Get('ac_custom_name'),
+ Get('cl_used_action'))
+ }
+ ]
+
+ Action.__init__(self)
diff --git core/utils/cl_core_setup.py core/utils/cl_core_setup.py
index 7d84869..900a213 100644
--- core/utils/cl_core_setup.py
+++ core/utils/cl_core_setup.py
@@ -31,7 +31,7 @@ class ClCoreSetupAction(Action):
# ошибки, которые отображаются без подробностей
native_error = (FilesError,TemplatesError,VariableError,DataVarsError)
templateTaskMessage = __("System are being configured")
- successMessage = __("System configured!")
+ successMessage = None
failedMessage = __("Failed to configure the system!")
interruptMessage = __("Configuration manually interrupted")
@@ -66,6 +66,7 @@ class ClCoreSetupAction(Action):
'cl_template_path_use,cl_ebuild_phase,'
'cl_template_clt_set)',
'condition':lambda dv:(dv.Get('cl_core_pkg_desktop_set') == 'on' and
+ dv.isModuleInstalled('desktop') and
not dv.Get('cl_ebuild_phase') in ("preinst","prerm"))
}
]
diff --git core/utils/cl_core_variables.py core/utils/cl_core_variables.py
index 38c3dfd..d0c5ef3 100644
--- core/utils/cl_core_variables.py
+++ core/utils/cl_core_variables.py
@@ -31,7 +31,7 @@ class ClCoreVariables(Action):
native_error = (FilesError,DataVarsError,VariableError)
successMessage = None
failedMessage = None
- interruptMessage = __("Setting manually interrupted")
+ interruptMessage = __("Variables modification manually interrupted")
tasks = [
{'name':'write_vars',
diff --git core/variables/__init__.py core/variables/__init__.py
index 7d3c43d..8e3dee1 100644
--- core/variables/__init__.py
+++ core/variables/__init__.py
@@ -20,5 +20,6 @@ import certificate
import groups
import setup_package
import variable
+import action
section = "core"
diff --git core/variables/action.py core/variables/action.py
new file mode 100644
index 0000000..25e3a2f
--- /dev/null
+++ core/variables/action.py
@@ -0,0 +1,59 @@
+#-*- coding: utf-8 -*-
+
+# Copyright 2013 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 os
+import sys
+from os import path
+from calculate.lib.datavars import (Variable,VariableError,ReadonlyVariable,
+ ActionVariable)
+
+from calculate.lib.cl_lang import setLocalTranslate
+from calculate.lib.cl_template import Template
+setLocalTranslate('cl_core3',sys.modules[__name__])
+
+class VariableAcCustomName(Variable):
+ """
+ Пользовательское действие для выполнения шаблонов
+ """
+ opt = ["ac_custom_name"]
+ metavalue = "ACTION"
+ type = "choice"
+ value = ""
+ untrusted = True
+
+ def init(self):
+ self.label = _("Custom action")
+ self.help = _("custom action")
+
+ def choice(self):
+ oldAction = self.Get('cl_action')
+ oldName = self.Get('ac_custom_name')
+ clTempl = Template(self.parent, cltObj = False)
+ try:
+ clTempl.applyTemplates()
+ except:
+ pass
+ finally:
+ self.parent.Set('cl_action',oldAction,force=True)
+ self.parent.Set('ac_custom_name',oldName,force=True)
+ clTempl.close()
+ return list(set(map(lambda x:x[1],
+ filter(lambda x:x[0] == 'ac_custom_name',
+ self.Get('cl_used_action')))))
+
+ def check(self,value):
+ if value == '':
+ raise VariableError(_("Need to specify action name"))
diff --git core/variables/certificate.py core/variables/certificate.py
index a9efbb5..4511ff6 100644
--- core/variables/certificate.py
+++ core/variables/certificate.py
@@ -165,7 +165,7 @@ class VariableClCertPerms(Variable):
return results
def uncompatible(self):
- return _('You can not change the certificate certificate')
+ return _('You can not change the certificate permissions')
class VariableClCertGroups(Variable):
"""
diff --git core/variables/setup_package.py core/variables/setup_package.py
index e2290ff..5f45dbd 100644
--- core/variables/setup_package.py
+++ core/variables/setup_package.py
@@ -19,6 +19,7 @@ from os import path
from calculate.lib.cl_lang import setLocalTranslate
from calculate.core.server.decorators import Dec
+import pwd
#from calculate.api.cert_cmd import find_id_cert
setLocalTranslate('cl_core3',sys.modules[__name__])
@@ -26,6 +27,7 @@ from calculate.lib.utils.files import listDirectory
from calculate.lib.utils.portage import isPkgInstalled,reVerSplitToPV, \
getPkgSlot
from calculate.lib.utils.common import getTupleVersion
+from calculate.lib.variables.user import VariableUrLogin
from itertools import *
import glob
@@ -211,3 +213,20 @@ class VariableClCorePkgRootSet(Variable):
def init(self):
self.label = _("Configure dependent packages in root")
self.help = _("configure the dependent packages in the same directory as the specified package, instead of root")
+
+class VariableUrCoreLogin(VariableUrLogin):
+ """
+ User Login
+ """
+ opt = ["--login"]
+ alias = "ur_login"
+
+ def check(self,value):
+ """Пользователь существует"""
+ try:
+ pwd.getpwnam(value).pw_gid
+ except:
+ raise VariableError(_("User %s does not exist")%value)
+
+ def get(self):
+ return self.Get('ur_login')
diff --git core/wsdl_core.py core/wsdl_core.py
index 2b4cdbc..94e74ef 100644
--- core/wsdl_core.py
+++ core/wsdl_core.py
@@ -23,6 +23,7 @@ setLocalTranslate('cl_core3',sys.modules[__name__])
__ = getLazyLocalTranslate(_)
import setup_package
+import custom_action
import server.certificate as certificate
import server.groups as groups
import server.request as request
@@ -38,6 +39,7 @@ from calculate.core.utils.cl_core_request import (ClCoreRequestShow,
ClCoreRequestConfirm,ClCoreRequestDel)
from calculate.core.utils.cl_core_variables import (ClCoreVariables,
ClCoreVariablesShow)
+from calculate.core.utils.cl_core_custom import ClCoreCustomAction
class Wsdl(WsdlBase):
methods = [
@@ -573,4 +575,40 @@ class Wsdl(WsdlBase):
lambda group:group(_("Setup variables"),
normal=('cl_variable_filter','cl_variable_show'),
next_label=_("Show"))]},
+ #
+ # отобразить переменные
+ #
+ {
+ # идентификатор метода
+ 'method_name':"core_custom",
+ # категория метода
+ 'category':__('Utilities'),
+ # заголовок метода
+ 'title':__("Custom action"),
+ # иконка для графической консоли
+ 'image':'gnome-desktop-config,desktop-config',
+ # метод в графической консоли
+ 'gui':True,
+ # консольная команда
+ 'command':'cl-core-custom',
+ # права для запуска метода
+ 'rights':['configure'],
+ # объект содержащий модули для действия
+ 'logic':{'UpdateConfigs':setup_package.UpdateConfigs},
+ # описание действия
+ 'action':ClCoreCustomAction,
+ # объект переменных
+ 'datavars':"core",
+ 'native_error':(VariableError,DataVarsError,
+ custom_action.CustomActionError),
+ # значения по умолчанию для переменных этого метода
+ 'setvars':{'cl_verbose_set':"on",'cl_human_edit_set':"on"},
+ # описание груп (список лямбда функций)
+ 'groups':[
+ lambda group:group(_("Custom action"),
+ normal=('ac_custom_name','cl_human_edit_set','cl_verbose_set'),
+ expert=('ur_core_login',
+ 'cl_templates_locate',
+ 'cl_dispatch_conf'),
+ next_label=_("Perform"))]},
]

@ -0,0 +1,289 @@
diff --git core/server/api_types.py core/server/api_types.py
index 8161a9e..0bca760 100644
--- core/server/api_types.py
+++ core/server/api_types.py
@@ -359,7 +359,7 @@ class ViewInfo(DataVarsSerializer):
varGroups = datavars.getGroups()
lastGroup = len(varGroups)-1
# interate all vars group
- if not onlyhelp and (step in(0,-1,None) or allsteps):
+ if step in(0,-1,None) or allsteps:
briefData = datavars.getBrief()
self.groups.append(self.stepGroup(varGroups,brief_label,
help_value=briefData.get("help",None),
diff --git core/server/func.py core/server/func.py
index fdee9d5..be7c323 100644
--- core/server/func.py
+++ core/server/func.py
@@ -1659,7 +1659,7 @@ class WsdlBase:
def clearDataVars(func):
def wrapper(*args,**kwargs):
try:
- func(*args,**kwargs)
+ return func(*args,**kwargs)
finally:
WsdlMeta.closeDataVars()
return wrapper
diff --git core/server/methods_func.py core/server/methods_func.py
index d546c1f..72014a2 100644
--- core/server/methods_func.py
+++ core/server/methods_func.py
@@ -501,10 +501,10 @@ def collect_object(client, param_object, view, args,wait_thread = None,
val)
elif field.element in ['input', 'openfile',\
- 'file', 'radio']:
+ 'file', 'radio','combo','comboEdit']:
param_object = set_obj_item(client, param_object, field.name,
_getattr(args, field.name))
- elif field.element in ['password'] and _getattr(args, field.name) \
+ elif 'passwd' in field.element and _getattr(args, field.name) \
or field.type and "need" in field.type:
if wait_thread:
wait_thread.pause()
@@ -517,21 +517,6 @@ def collect_object(client, param_object, view, args,wait_thread = None,
password)
if wait_thread:
wait_thread.resume()
- elif field.element in ['combo', 'comboEdit']:
- value = _getattr(args, field.name)
- if value:
- if hasattr (field.choice, 'string'):
- choice = field.choice.string
- else:
- choice = field.choice
- for item in choice:
- if item:
- if value.lower() == item.lower():
- value = item
- break
-
- param_object = set_obj_item(client, param_object, field.name,
- value)
elif field.element in ['multichoice', 'multichoice_add', \
'selecttable', 'selecttable_add']:
val = _getattr(args, field.name)
diff --git core/server/replace_class.py core/server/replace_class.py
index 860ede2..02ea194 100644
--- core/server/replace_class.py
+++ core/server/replace_class.py
@@ -515,7 +515,7 @@ def call_method(metaObject, args, unknown_args, colorPrint):
view_obj.step = None
view_obj.expert = True
view_obj.brief = None
- view_obj.onlyhelp = False
+ view_obj.onlyhelp = True
try:
view = getattr(metaObject, method_view_name)(0, view_obj)
diff --git core/utils/cl_core_custom.py core/utils/cl_core_custom.py
new file mode 100644
index 0000000..518f4cd
--- /dev/null
+++ core/utils/cl_core_custom.py
@@ -0,0 +1,56 @@
+#-*- coding: utf-8 -*-
+
+# Copyright 2013 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
+from calculate.core.server.func import Action,Tasks
+from calculate.lib.cl_lang import setLocalTranslate,getLazyLocalTranslate
+from calculate.lib.datavars import VariableError
+from calculate.lib.cl_template import TemplatesError
+from calculate.lib.utils.files import FilesError
+
+setLocalTranslate('cl_install3',sys.modules[__name__])
+__ = getLazyLocalTranslate(_)
+
+class ClCoreCustomAction(Action):
+ """
+ Действие для настройки параметров видео
+ """
+ # ошибки, которые отображаются без подробностей
+ native_error = (FilesError, TemplatesError,VariableError)
+
+ successMessage = __("Custom action successfully completed!")
+ failedMessage = __("Failed to perform custom action!")
+ interruptMessage = __("Custom action manually interrupted")
+
+ def __init__(self):
+ # список задач для дейсвия
+ self.tasks = [
+ {'name':'apply_templates',
+ # наложить шаблоны на текущий дистрибутив, включая clt шаблоны
+ # без использования фильтров по clt шаблонам
+ 'method':'UpdateConfigs.applyTemplates(None,False,'\
+ 'None,None)',
+ },
+ {'name':'failed_action',
+ 'error':__("Action {ac_custom_name} not found"),
+ 'condition':lambda Get:not filter(
+ lambda x:x and x[0] == 'ac_custom_name' and \
+ x[1] == Get('ac_custom_name'),
+ Get('cl_used_action'))
+ }
+ ]
+
+ Action.__init__(self)
diff --git core/utils/cl_core_setup.py core/utils/cl_core_setup.py
index 7d84869..900a213 100644
--- core/utils/cl_core_setup.py
+++ core/utils/cl_core_setup.py
@@ -31,7 +31,7 @@ class ClCoreSetupAction(Action):
# ошибки, которые отображаются без подробностей
native_error = (FilesError,TemplatesError,VariableError,DataVarsError)
templateTaskMessage = __("System are being configured")
- successMessage = __("System configured!")
+ successMessage = None
failedMessage = __("Failed to configure the system!")
interruptMessage = __("Configuration manually interrupted")
@@ -66,6 +66,7 @@ class ClCoreSetupAction(Action):
'cl_template_path_use,cl_ebuild_phase,'
'cl_template_clt_set)',
'condition':lambda dv:(dv.Get('cl_core_pkg_desktop_set') == 'on' and
+ dv.isModuleInstalled('desktop') and
not dv.Get('cl_ebuild_phase') in ("preinst","prerm"))
}
]
diff --git core/utils/cl_core_variables.py core/utils/cl_core_variables.py
index 38c3dfd..d0c5ef3 100644
--- core/utils/cl_core_variables.py
+++ core/utils/cl_core_variables.py
@@ -31,7 +31,7 @@ class ClCoreVariables(Action):
native_error = (FilesError,DataVarsError,VariableError)
successMessage = None
failedMessage = None
- interruptMessage = __("Setting manually interrupted")
+ interruptMessage = __("Variables modification manually interrupted")
tasks = [
{'name':'write_vars',
diff --git core/variables/certificate.py core/variables/certificate.py
index a9efbb5..4511ff6 100644
--- core/variables/certificate.py
+++ core/variables/certificate.py
@@ -165,7 +165,7 @@ class VariableClCertPerms(Variable):
return results
def uncompatible(self):
- return _('You can not change the certificate certificate')
+ return _('You can not change the certificate permissions')
class VariableClCertGroups(Variable):
"""
diff --git core/variables/setup_package.py core/variables/setup_package.py
index e2290ff..5f45dbd 100644
--- core/variables/setup_package.py
+++ core/variables/setup_package.py
@@ -19,6 +19,7 @@ from os import path
from calculate.lib.cl_lang import setLocalTranslate
from calculate.core.server.decorators import Dec
+import pwd
#from calculate.api.cert_cmd import find_id_cert
setLocalTranslate('cl_core3',sys.modules[__name__])
@@ -26,6 +27,7 @@ from calculate.lib.utils.files import listDirectory
from calculate.lib.utils.portage import isPkgInstalled,reVerSplitToPV, \
getPkgSlot
from calculate.lib.utils.common import getTupleVersion
+from calculate.lib.variables.user import VariableUrLogin
from itertools import *
import glob
@@ -211,3 +213,20 @@ class VariableClCorePkgRootSet(Variable):
def init(self):
self.label = _("Configure dependent packages in root")
self.help = _("configure the dependent packages in the same directory as the specified package, instead of root")
+
+class VariableUrCoreLogin(VariableUrLogin):
+ """
+ User Login
+ """
+ opt = ["--login"]
+ alias = "ur_login"
+
+ def check(self,value):
+ """Пользователь существует"""
+ try:
+ pwd.getpwnam(value).pw_gid
+ except:
+ raise VariableError(_("User %s does not exist")%value)
+
+ def get(self):
+ return self.Get('ur_login')
diff --git core/wsdl_core.py core/wsdl_core.py
index 2b4cdbc..94e74ef 100644
--- core/wsdl_core.py
+++ core/wsdl_core.py
@@ -23,6 +23,7 @@ setLocalTranslate('cl_core3',sys.modules[__name__])
__ = getLazyLocalTranslate(_)
import setup_package
+import custom_action
import server.certificate as certificate
import server.groups as groups
import server.request as request
@@ -38,6 +39,7 @@ from calculate.core.utils.cl_core_request import (ClCoreRequestShow,
ClCoreRequestConfirm,ClCoreRequestDel)
from calculate.core.utils.cl_core_variables import (ClCoreVariables,
ClCoreVariablesShow)
+from calculate.core.utils.cl_core_custom import ClCoreCustomAction
class Wsdl(WsdlBase):
methods = [
@@ -573,4 +575,40 @@ class Wsdl(WsdlBase):
lambda group:group(_("Setup variables"),
normal=('cl_variable_filter','cl_variable_show'),
next_label=_("Show"))]},
+ #
+ # отобразить переменные
+ #
+ {
+ # идентификатор метода
+ 'method_name':"core_custom",
+ # категория метода
+ 'category':__('Utilities'),
+ # заголовок метода
+ 'title':__("Custom action"),
+ # иконка для графической консоли
+ 'image':'gnome-desktop-config,desktop-config',
+ # метод в графической консоли
+ 'gui':True,
+ # консольная команда
+ 'command':'cl-core-custom',
+ # права для запуска метода
+ 'rights':['configure'],
+ # объект содержащий модули для действия
+ 'logic':{'UpdateConfigs':setup_package.UpdateConfigs},
+ # описание действия
+ 'action':ClCoreCustomAction,
+ # объект переменных
+ 'datavars':"core",
+ 'native_error':(VariableError,DataVarsError,
+ custom_action.CustomActionError),
+ # значения по умолчанию для переменных этого метода
+ 'setvars':{'cl_verbose_set':"on",'cl_human_edit_set':"on"},
+ # описание груп (список лямбда функций)
+ 'groups':[
+ lambda group:group(_("Custom action"),
+ normal=('ac_custom_name','cl_human_edit_set','cl_verbose_set'),
+ expert=('ur_core_login',
+ 'cl_templates_locate',
+ 'cl_dispatch_conf'),
+ next_label=_("Perform"))]},
]

@ -16,6 +16,8 @@ AUX calculate-lib-3.1.6-r5.patch 14197 SHA256 e520e126543f255edf2aa0ea684a8fda42
AUX calculate-lib-3.1.6-r6.patch 14666 SHA256 ea29b36de5052200d2b73cace50185021a62118e7c56bbb50dc8c3fc7f848a16 SHA512 89b209277f686057efaa56494bee9ce55e7b0025450e5f084cd0ab60fcc38593922658381ea4edde6d8ce81ddb0b39661f744751636e4e6e556658821a3a370e WHIRLPOOL 915280ce9224fab13a324fc57b3e584f382834eb74fc966cc4bcb551a208dd0a23556ef264984428248011285a52227f803c0a27290ee98fcf8f0a474cb536a6
AUX calculate-lib-3.1.6-r7.patch 18897 SHA256 c69c10571632e477023fbf7ccbb7ca9ed6caf6d8605b6ffe254a84833f9bb1b7 SHA512 6393d10e99cc589cb3c72524a43537190f091987c97a25b7a1c1b36e2ed282c23bfbc597e6758d729cea5472afa24fa5032c46155c8d2313e65d45d62df3b716 WHIRLPOOL c78681fb28c08ef6fe3a1f161c5c4203b7c588f5b57855e12847ae5395b5108382a22e38f2cfc6549b5101d85a800a5f93f8b74907d36424edc8bd367cc18ebe
AUX calculate-lib-3.1.7-r1.patch 1034 SHA256 9bca1fa0c02fa2d75c0e8d8ca1e86d9a92c1c885d2c95e2550a164421e4b7452 SHA512 c219ced4e75eb89e2abb1c7ebd8b8a27570d5caaa9ece095347a5d56d83749b60ce47a4b61fff544eddd21408250dc02d777c7655fe410c33ac5b8a58ebb814b WHIRLPOOL 4be1f0c28fbe03e62e514b76d386dca2740fb5b7141338f908c7d7e6a3f258d2769e7467bad341fe1e76ab0841a9647c05497eb6925fc3bf6c70c90f44b42ff6
AUX calculate-lib-3.1.7-r2.patch 3241 SHA256 f211f0ac23cbc0af1debd6338988b255e04ba6544abc85557b1a27dbb47c038e SHA512 ca0bb9b95dd5594861c66ea19c94e788d53099801f251421f002637d2f15763bc9d1d9bf47272c49bd3b2fb75755520ae59a8ddf294c9c2293ab4187767dcf3e WHIRLPOOL 0c56fac55830460ef78a398d984217794658d1a33bb66665ddccc650b450a60695276ce0c054c60880dc0bdc0586afa5bee5a7a3893620f3cd612581b10723ef
AUX calculate-lib-3.1.7-r3.patch 5898 SHA256 4eefddb2ef84f8fb0286b01668f74ca050a7e645598f616e725600c16e5fefde SHA512 b884c4fedf15e830e106ea79edf4cb91084cca0ae15eff221e8568dcf49e08ed500e05181baf3baef66a02a15138dcdd00210ab6ad3447a6a3aeab0bbb7d5bba WHIRLPOOL c8167da016fd7df5f7a3c961d4b2b596025dc4441e4d782efdcb85d0acfa190d49f2459cfff5e35c7919b71717f2d089c67b6be3bbb42597b45cb3e61f3c77c6
DIST calculate-lib-2.1.11.tar.bz2 61687 SHA256 62976c08d4fb4810389ace6f5a99abb5a962f6c8d9053ff943d0669480fb5599 SHA512 e3bc2168a55367cf19ad3a27921b53e5e845643238bf171209ab29752c91b5d4d338a2120774764ac1c79abd93f2deff8680f8faa1407940984ea9fd6a199e67 WHIRLPOOL 0ced92ea493dd8db02b0ae1514ebbb51ee76dc6f441b4a38c984c39da2121fb81dd1f2e840c4c5b71a117a12817a2a269d85676288202aa9801f69727e3338dc
DIST calculate-lib-2.2.31.tar.bz2 120044 SHA256 ba38052d8b2349a1c60adc589a74eb8a3ffcbf6f3c1124e4c1fb0da3aa777f12 SHA512 902871b9159f2bcf7a0cc767fb6df5b19902fce6cf9468d96f902c383a422738b65debe3094c92d1f82de2124936496f89631c6eb9670da00807b63156b101b7 WHIRLPOOL 5179ee691519f3a7faa3135d040ad64bd6d67c026ebf39bb17f7d641130a2b58641d1fe5da4f6cfbd45d4442d93508f0a5f641ef2cd8c43e1a322aab3d11f4b9
DIST calculate-lib-3.1.5.tar.bz2 121086 SHA256 3809b0e89c56414d488c931b279956562d6dc445ccbc385268e9881d495cec2b SHA512 9372dba87a96e79150bc26c43d49efbe90b4d1d9bf9f79b3a536663c0b621263333a792678f589a65335f230d60042254b1cdb5187760e2faac8f88b34eeb714 WHIRLPOOL f59751e50fcb0c0b95a91d0d5e45611a752dbe7b98a40289b8732a2fbb887bbfe83c5e63be4a81dd5be12ca715e32a1f4e6d50b62edd97a0f60fdd1e9da7595c
@ -37,6 +39,8 @@ EBUILD calculate-lib-3.1.6-r6.ebuild 824 SHA256 4cf872134d3a42212d0b6f9aebd9ca1a
EBUILD calculate-lib-3.1.6-r7.ebuild 824 SHA256 5aab4e17277422301131329e5204459c99eb3fb523df5b21c59f429620776594 SHA512 47f0eaf9575573b2fd490b5eb2615f9cd9625dd700730ca33b430b272a8707697e7de0fb1c43adba0d6f558f92b193910c2c77e3ec336b1532d4946304b7a773 WHIRLPOOL bbc8b530cb1b3ebbd1783cf1ba9f8511ba1811d49980eb8c9bb6cde7472fea10b2ad3ac572f0b44b5c72e5d76a213650b12ee869fc152304adf4a8d3a5d90752
EBUILD calculate-lib-3.1.6.ebuild 692 SHA256 565d13cfdd515cb534e56bdcb3c00e7182194d12c8de259851ec9fc5230b28a3 SHA512 a437100783152c3413c4184e90c5820f56529d1cee2e11dc4f0e88acfe3d3267b0fb85a3a9b04193709447f10dc4815d8c49e612ffe02e497a22acef11d68d95 WHIRLPOOL 3411233d326b21fe63e17106f425fec71a21c4cb77bee3d201b97a81870d76fa8a842e96515573b30aba88bb9209301607d8bc982f16b2406b70f9a84c8b4ee9
EBUILD calculate-lib-3.1.7-r1.ebuild 824 SHA256 62a7a29f69d0ffed572118ae52001b5cf1ea393f7b10208c741776ce321c5c59 SHA512 9fb3d89e23505abb89279ea61a83797a9aaaf2422e4e654e12fb567e7f343c8ac110fbc3d6fa56baf35f3f791a36b151cbfb21a6699abd0873651970e0c9aee5 WHIRLPOOL 6c6a32c36826158ca9e8043d50ad3edebb66bee54d890cc7d971945dea9d35421e1db82a4a0bdeeb311fc64f8f5e621879912fdf11507e87bb96f88bde0ed555
EBUILD calculate-lib-3.1.7-r2.ebuild 824 SHA256 63db02bd40925103f88cc7dd02b5d53814b3b725c9db7d40cb80c3ca33e4f59a SHA512 3407dd86bfd2d6fcc9af4b5d9b7a2b8a3618c41fb0fe2a5b3b244352d64853b8090dfc032ff3d5b065d9ae49e578b47de685532c1592d3f00ab183bbe401218e WHIRLPOOL 095ffcf98a7f72274debc1b06052a8104c9872180c9c9db56b3dbbc17571928ff66cabc219491d3e4d92e14f5227713219b9a2cfca3dfb9bdf6af1be2b4db68e
EBUILD calculate-lib-3.1.7-r3.ebuild 824 SHA256 01bba1e8ca7dea02d601d3f6232d228f36c32b9cb9c07cf0bcd17b65a5cd0d34 SHA512 83b3fd4006b117e0a3f4321d3d4df7277943f485580a664692b911f47438010d7b82ceb6cdf5520c375bb0d2ccb9e32dfc9aabdfd012b2e863f70dd15df19b4b WHIRLPOOL f7c7d2cec09ae9958e0cb615d40202486b54d949f5e107f829ee5140cbe9f535085ddd0b7592e0747884ad3c4791a85980462f826d5b31642e128ae8bed0036d
EBUILD calculate-lib-3.1.7.ebuild 690 SHA256 c89c29f5de3f70146e98f15035366506933f03e8a5066b1ad55aeccbebdeae2c SHA512 a7277c2e5fa64a5e5840be7fc8d3df9a31f41926386c5fe6a9bed31eeed6321af5881c218d9ce7eeb12aee518edb682b438e10397dcb815cc63645100430e43e WHIRLPOOL 8f19e4d46381e26fec81e20fa35599f4658b3891d6372c921a8b1354ad3b1821ea9c78f71caebf54610e0b5aacfb6e6ded018e155e1979322406a0ac1e823d09
EBUILD calculate-lib-3.1.7_alpha3.ebuild 681 SHA256 6a6332013e5a56db775c6490b63b60f959528660b0982e6a414f1614c0b0ffa5 SHA512 19a71823543fe843a05a548207509ee4dcffa784c61e23c56cf17d2c651effbfc63914beb03f0977b804c5cc647407eecdcbdaed4d7478783bec46eee72a50fb WHIRLPOOL 5ffd414c804671057fe2a7a2176999eee0a75574a5043332d3c01f08b93635773800e6b5d9901993e4fbf7f95d175659d621be9231d08f8bdada2654e45f8e1d
EBUILD calculate-lib-3.1.9999.ebuild 708 SHA256 a1d64b7f014831bf6b0a38928d53cb55758b7a12e5f3e98fffd28025ffacbce1 SHA512 3873859a791941d421e2338b437521955da383ce986408f1a951305e2dd75a1a4f771c9ec2caa096c5c8ea6a1776d6d0ed99e025ffa786ba029cafdbadfa439b WHIRLPOOL 5ac1a10b53f810ab527a0ebe52bc87e8397e61375cf6e0acbed89d8f6b8385e72bf234e0fdce479c3a3f1652bb6e520710ce9356750a97d644c0db0a33f6facb

@ -0,0 +1,36 @@
# 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 library for Calculate 3"
HOMEPAGE="http://www.calculate-linux.org/main/en/calculate2"
LICENSE="Apache-2.0"
SLOT="3"
KEYWORDS="amd64 x86"
IUSE="minimal"
DEPEND="!minimal? ( dev-python/py-smbpasswd )
>=dev-python/pyxml-0.8
sys-apps/iproute2
sys-apps/pciutils
sys-fs/lvm2
sys-fs/mdadm
dev-python/pyinotify
sys-apps/file[python]"
RDEPEND="${DEPEND}"
src_unpack() {
unpack "${A}"
cd "${S}"
# apply revision changes
epatch "${FILESDIR}/calculate-lib-3.1.7-r2.patch"
}

@ -0,0 +1,36 @@
# 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 library for Calculate 3"
HOMEPAGE="http://www.calculate-linux.org/main/en/calculate2"
LICENSE="Apache-2.0"
SLOT="3"
KEYWORDS="amd64 x86"
IUSE="minimal"
DEPEND="!minimal? ( dev-python/py-smbpasswd )
>=dev-python/pyxml-0.8
sys-apps/iproute2
sys-apps/pciutils
sys-fs/lvm2
sys-fs/mdadm
dev-python/pyinotify
sys-apps/file[python]"
RDEPEND="${DEPEND}"
src_unpack() {
unpack "${A}"
cd "${S}"
# apply revision changes
epatch "${FILESDIR}/calculate-lib-3.1.7-r3.patch"
}

@ -0,0 +1,84 @@
diff --git calculate/lib/cl_template.py calculate/lib/cl_template.py
index efda545..5c6e50a 100644
--- calculate/lib/cl_template.py
+++ calculate/lib/cl_template.py
@@ -327,6 +327,8 @@ class _terms(_error, _shareTermsFunction):
else:
try:
valVars = self.objVar.Get(vals[0])
+ varTable = self.objVar.Get('cl_used_action')
+ varTable.append((vals[0],vals[1]))
if not valVars:
valVars = ""
except DataVarsError, e:
diff --git calculate/lib/variables/X11.py calculate/lib/variables/X11.py
index 72de72b..ad33e27 100644
--- calculate/lib/variables/X11.py
+++ calculate/lib/variables/X11.py
@@ -18,7 +18,7 @@ import os
import re
from os import path
from calculate.lib.datavars import Variable,VariableError,ReadonlyVariable
-from calculate.lib.utils.files import process, readLinesFile
+from calculate.lib.utils.files import process, readLinesFile,FilesError
from calculate.lib.utils.common import (getAvailableVideo, getValueFromCmdLine,
getVideoFromXorgLog, getVideoFromXorgConf, getVideoFromCmdLine,
getCompositeFromXorgconf,getTupleVersion,
@@ -36,7 +36,7 @@ class VariableOsX11Resolution(Variable):
processXDpy = process('xdpyinfo')
if processXDpy.failed():
return ""
- except OSError:
+ except (FilesError,OSError) as e:
return ""
lines = processXDpy.readlines()
reRes = re.compile("dimensions:\s+(\d+)x(\d+)\s+pixels")
diff --git calculate/lib/variables/env.py calculate/lib/variables/env.py
index 094afcd..6d376e5 100644
--- calculate/lib/variables/env.py
+++ calculate/lib/variables/env.py
@@ -204,12 +204,26 @@ class VariableClAutoupdateSet(Variable):
else:
return "off"
+class VariableClHumanEditSet(Variable):
+ """
+ Параметр для отметки "ручной правки"
+ """
+ type = "bool"
+ opt = ["--human-edit"]
+ value = "off"
+
+ def init(self):
+ self.help = _("mark as human modification")
+ self.label = _("Mark as human modification")
+
class VariableClProtectUseSet(ReadonlyVariable):
"""
Использовать portage интеграцию с конфигурационными файлами
"""
type = "bool"
- value = "on"
+
+ def get(self):
+ return "on" if self.Get('cl_human_edit_set') == 'off' else "off"
class VariableClDispatchConf(Variable):
"""
diff --git calculate/lib/variables/system.py calculate/lib/variables/system.py
index 08593ef..70bcf87 100644
--- calculate/lib/variables/system.py
+++ calculate/lib/variables/system.py
@@ -145,3 +145,12 @@ class VariableOsUefiSet(ReadonlyVariable):
return "on"
else:
return "off"
+
+class VariableClUsedAction(ReadonlyVariable):
+ """
+ Переменная содержит все найденные при обработке шаблонов
+ событийные переменные (ac_)
+ """
+ type = "table"
+ def get(self):
+ return []

@ -0,0 +1,161 @@
diff --git calculate/lib/cl_template.py calculate/lib/cl_template.py
index efda545..5c6e50a 100644
--- calculate/lib/cl_template.py
+++ calculate/lib/cl_template.py
@@ -327,6 +327,8 @@ class _terms(_error, _shareTermsFunction):
else:
try:
valVars = self.objVar.Get(vals[0])
+ varTable = self.objVar.Get('cl_used_action')
+ varTable.append((vals[0],vals[1]))
if not valVars:
valVars = ""
except DataVarsError, e:
diff --git calculate/lib/variables/X11.py calculate/lib/variables/X11.py
index 72de72b..ad33e27 100644
--- calculate/lib/variables/X11.py
+++ calculate/lib/variables/X11.py
@@ -18,7 +18,7 @@ import os
import re
from os import path
from calculate.lib.datavars import Variable,VariableError,ReadonlyVariable
-from calculate.lib.utils.files import process, readLinesFile
+from calculate.lib.utils.files import process, readLinesFile,FilesError
from calculate.lib.utils.common import (getAvailableVideo, getValueFromCmdLine,
getVideoFromXorgLog, getVideoFromXorgConf, getVideoFromCmdLine,
getCompositeFromXorgconf,getTupleVersion,
@@ -36,7 +36,7 @@ class VariableOsX11Resolution(Variable):
processXDpy = process('xdpyinfo')
if processXDpy.failed():
return ""
- except OSError:
+ except (FilesError,OSError) as e:
return ""
lines = processXDpy.readlines()
reRes = re.compile("dimensions:\s+(\d+)x(\d+)\s+pixels")
diff --git calculate/lib/variables/__init__.py calculate/lib/variables/__init__.py
index 1c1d90a..b703d5c 100644
--- calculate/lib/variables/__init__.py
+++ calculate/lib/variables/__init__.py
@@ -25,6 +25,7 @@ import linux
import net
import user
import system
+import action
from calculate.lib.cl_lang import setLocalTranslate
setLocalTranslate('cl_lib3',sys.modules[__name__])
diff --git calculate/lib/variables/action.py calculate/lib/variables/action.py
new file mode 100644
index 0000000..ff7ee20
--- /dev/null
+++ calculate/lib/variables/action.py
@@ -0,0 +1,59 @@
+#-*- coding: utf-8 -*-
+
+# Copyright 2013 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 os
+import sys
+from os import path
+from calculate.lib.datavars import (Variable,VariableError,ReadonlyVariable,
+ ActionVariable)
+
+from calculate.lib.cl_lang import setLocalTranslate
+from calculate.lib.cl_template import Template
+setLocalTranslate('cl_lib3',sys.modules[__name__])
+
+class VariableAcCustomName(Variable):
+ """
+ Пользовательское действие для выполнения шаблонов
+ """
+ opt = ["ac_custom_name"]
+ metavalue = "ACTION"
+ type = "choice"
+ value = ""
+ untrusted = True
+
+ def init(self):
+ self.label = _("Custom action")
+ self.help = _("custom action")
+
+ def choice(self):
+ oldAction = self.Get('cl_action')
+ oldName = self.Get('ac_custom_name')
+ clTempl = Template(self.parent, cltObj = False)
+ try:
+ clTempl.applyTemplates()
+ except:
+ pass
+ finally:
+ self.parent.Set('cl_action',oldAction,force=True)
+ self.parent.Set('ac_custom_name',oldName,force=True)
+ clTempl.close()
+ return list(set(map(lambda x:x[1],
+ filter(lambda x:x[0] == 'ac_custom_name',
+ self.Get('cl_used_action')))))
+
+ def check(self,value):
+ if value == '':
+ raise VariableError(_("Need to specify action name"))
diff --git calculate/lib/variables/env.py calculate/lib/variables/env.py
index 094afcd..6d376e5 100644
--- calculate/lib/variables/env.py
+++ calculate/lib/variables/env.py
@@ -204,12 +204,26 @@ class VariableClAutoupdateSet(Variable):
else:
return "off"
+class VariableClHumanEditSet(Variable):
+ """
+ Параметр для отметки "ручной правки"
+ """
+ type = "bool"
+ opt = ["--human-edit"]
+ value = "off"
+
+ def init(self):
+ self.help = _("mark as human modification")
+ self.label = _("Mark as human modification")
+
class VariableClProtectUseSet(ReadonlyVariable):
"""
Использовать portage интеграцию с конфигурационными файлами
"""
type = "bool"
- value = "on"
+
+ def get(self):
+ return "on" if self.Get('cl_human_edit_set') == 'off' else "off"
class VariableClDispatchConf(Variable):
"""
diff --git calculate/lib/variables/system.py calculate/lib/variables/system.py
index 08593ef..70bcf87 100644
--- calculate/lib/variables/system.py
+++ calculate/lib/variables/system.py
@@ -145,3 +145,12 @@ class VariableOsUefiSet(ReadonlyVariable):
return "on"
else:
return "off"
+
+class VariableClUsedAction(ReadonlyVariable):
+ """
+ Переменная содержит все найденные при обработке шаблонов
+ событийные переменные (ac_)
+ """
+ type = "table"
+ def get(self):
+ return []

@ -23,6 +23,8 @@ EBUILD calculate-utilities-3.1.7-r1.ebuild 752 SHA256 506f1d908e8c5bce6fae29056c
EBUILD calculate-utilities-3.1.7-r10.ebuild 767 SHA256 e1f47b8b3b33f155ac757cd5400a941cdeed278da3f302cf47866bd41a60cec8 SHA512 b098f9f1e45dddfa8a87a41b717eabafc147954cefdd5be82e09cfe1e943e119d46a1766d78e0ed6e6c0993c92596ddfe1e7bdf40113e87edb0bbc5156997d8e WHIRLPOOL ab12ec4b6e2c9bccb9c47d6da021b776ca7a6928d12453815e97831b33ac9588d26ea3a2e9e1d576e10595be5eddef1176d9a299f266472b7a7c6e71fb105be2
EBUILD calculate-utilities-3.1.7-r11.ebuild 767 SHA256 0adbefc3a2cb3bf54e34080cc585128bd8dc6163f9b5134e0a51e732d4f13c23 SHA512 0fa44aeb4cdf6d7702b38fa4cd8094b47271ebf90f4535dfc76f8bbac9e34e34909259128b83783040a664f86dc13f1e926f2e93a46ae2c687804b7cb5ca6756 WHIRLPOOL 0c8fbfab18a50e34379829ee4863f8f4af76fc96fde30820ee9658d6294b2c87b15f179d4de9161d600c4e05857a2255e4a21aa249f96762ce2311cc113ba2f7
EBUILD calculate-utilities-3.1.7-r12.ebuild 767 SHA256 9af8074985d683b55a57cea97b3c082e7f9280f1bce79f858aca1d6982d0a3e8 SHA512 996efeaf8119ea7938939b2242430088f441cf8c94e9efc23a74000d25d1ff373c25976563b8b768f6352965381eaa7b628716b4569fa93cdb7e4dd3a902515f WHIRLPOOL 7e7c9b192212eb1131dff95c51b02a315ec5aa1ab2fa1f05b721c6339e2c3ee0fbefa28ff4df31453406b596c9fe2632b3300437bc659790b52abd23d6b2842c
EBUILD calculate-utilities-3.1.7-r13.ebuild 767 SHA256 12d0222983f755feb4b16a5b5881bae21a586b5a79362661274ab1328576d713 SHA512 22d3309ba918ded0f85bec95f0333e50bbe9c073a4255dd8ae834bc7fb9cf1836e320fdc5ac698026b6933efddb4bfedeb902f49c59c868f3f191f85284e69b9 WHIRLPOOL 20ba31d7e49a2e9979f6f1d6de3ebddb7bc14301e605eb7e41723abd28e752513e21f13b822686bb56984b2a4d8dc8c07091d6983a0e981f40d4d6f1450c9c8b
EBUILD calculate-utilities-3.1.7-r14.ebuild 767 SHA256 7a399e8b66f71c8469ae74a22d7620db7e633ba32f08e54d19732ff0491a3816 SHA512 717f2e3279c1d970342cf4c4973becb60a7919db0aa7ba0d47a9a55fe5de351d856d243f139fb3753477198d4bb56d8c4ee1cb266e8440e8a30459ac2e4383eb WHIRLPOOL bb8263c4ac6cc0a0c82e0823ec53f05245a00432e249d74f001673bffec36aaea0d9856fe0701ebafa38c7adb458378d77371b91b95aaad38c48b2ce2288c400
EBUILD calculate-utilities-3.1.7-r2.ebuild 761 SHA256 a8d68add7993bf5b4db8235dbad7158cd9b4b6b803af9c1bb9c690b40d0033d7 SHA512 13458804fbd04a44ac5a253edfa3877b8c31b665d8b5f6c9983066d5a6c3fdfcfc7f4ef57b89be4ec6c5343cb0faad6dce31bb5897fefa4b68eab33e6140ac3f WHIRLPOOL 7a73cb1dde57bc32faf28a2b90bde17e5f91dfa94b3ee49e9a56693a33152b6d08ca06ed3ee5ec39a4e98e62a6e612f0a62b3ef8ea28d690456ed3016f4f699f
EBUILD calculate-utilities-3.1.7-r3.ebuild 761 SHA256 2bd5a011805391c9ea03f0a58b622ab8ebb8906f288abdc0c1ce7031ae930657 SHA512 ddc9ee47a3d04e112036e175986e8bf01fb1e8ef33cddd2fc69cc01f56df22bf7c20c1db144da8abedb2b15e7ec9644615a0676c267f47842498496e0c9d88ea WHIRLPOOL f1db0c0573abf5c238b9c76a4112313b0f57f4a43599e8a082a0e19bdfbcf991b5f3f4452f0473d30a6808a48e18933f0734331e2bb5ff2cdb9e88a7a2f66f0b
EBUILD calculate-utilities-3.1.7-r4.ebuild 761 SHA256 eb606a6659e4d07aa32047105ce661fa6c9e38559aecbb9c32ce606d307e2a75 SHA512 4f9d7a6099c6eaffacaf358ff0e6ba82b0565c1f5f5c9783ed31c59c4d47b4ba921e575d850f34abd1e29676044443bcaa835c83ab432ac7499c4f7f193b8605 WHIRLPOOL ef63faaf1967f416fbe4b1d3841725c57979c100a9b8b8ec391f0b0d4cc90ebbc795d3d23f6cf229088892bf1732a8f3fd0d52772c8626560ff5b50eb7510138

@ -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.1.7-r5
=sys-apps/calculate-i18n-3.1.7
=sys-apps/calculate-lib-3.1.7-r2
=sys-apps/calculate-core-3.1.7-r7
=sys-apps/calculate-update-3.1.7
cl_client? ( =sys-apps/calculate-client-3.1.7-r3 )
cl_desktop? ( =sys-apps/calculate-desktop-3.1.7-r1 )
cl_consolegui? ( =sys-apps/calculate-console-gui-3.1.7-r1 )
cl_console? ( =sys-apps/calculate-console-3.1.7 )
"

@ -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.1.7-r5
=sys-apps/calculate-i18n-3.1.7
=sys-apps/calculate-lib-3.1.7-r3
=sys-apps/calculate-core-3.1.7-r8
=sys-apps/calculate-update-3.1.7
cl_client? ( =sys-apps/calculate-client-3.1.7-r3 )
cl_desktop? ( =sys-apps/calculate-desktop-3.1.7-r1 )
cl_consolegui? ( =sys-apps/calculate-console-gui-3.1.7-r1 )
cl_console? ( =sys-apps/calculate-console-3.1.7 )
"
Loading…
Cancel
Save