from calculate.lib.cl_lang import setLocalTranslate,getLazyLocalTranslate
from calculate.core.server.decorators import Dec
from calculate.core.server.func import catchExcept,commonView
core_method = Dec.core_method
setLocalTranslate('cl_update3',sys.modules[__name__])
import traceback
from functools import wraps,WRAPPER_ASSIGNMENTS

__ = getLazyLocalTranslate(_)

class UpdateInfo(CommonInfo):
    """Parameters for method install"""
    cl_update_rev_set = String
    cl_rebuild_world_set = String

updateCatchExcept = catchExcept(VariableError,DataVarsError,
                                 cl_update.UpdateError)

class Wsdl:
    """
    cl-update
    """
    @rpc(Integer, UpdateInfo, _returns = Array(ReturnedMessage))
    @core_method(category=__('Update'),title=__('Update world'),
        image='software-properties,preferences-desktop',
        gui=True,command='cl-update',
        rights=['update'])
    def update(self, sid, info):
        return self.callMethod(sid,info,method_name="update",
                               logicClass=Update,
                               method="update")
Exemple #2
0
from calculate.core.datavars import DataVarsCore
from calculate.lib.datavars import Variable,DataVarsError,VariableError
from calculate.lib.cl_log import log
from calculate.lib import datavars
from calculate.lib.utils.files import (scanDirectory, pathJoin)
from calculate.lib.utils.common import getPasswdUsers
import pwd
from calculate.lib.utils.files import getModeFile
import calculate.lib.cl_template as cl_template

from calculate.lib.cl_lang import setLocalTranslate,getLazyLocalTranslate
setLocalTranslate('cl_core3',sys.modules[__name__])

__ = getLazyLocalTranslate(_)

setvarsCatchExcept = catchExcept(VariableError,DataVarsError)

class SetVariablesInfo(ClassSerializer):
    """Parameters for method set variables"""
    cl_variable_data = Array(Array(String))
    cl_variable_filter = String
    cl_variable_show = String

    Default = Array(String)
    CheckOnly = Boolean

VARIABLE,MODE,LOCATION,VALUE = 0,1,2,3

class SetVariables:
    def writeVariables(self,dv):
        """
    cl_remote_host_new = String
    cl_remote_pw = String
    cl_client_mount_set = Boolean

class ClientPasswdInfo(CommonInfo):
    """Parameters for method install"""
    ur_login = String
    ur_user_pw = String
    ur_user_new_pw = String

class SyncInfo(CommonInfo):
    """Parameters for method install"""
    ur_login = String
    cl_client_sync = Boolean

clientCatchExcept = catchExcept(VariableError,DataVarsError,
                                ClientError)

class Wsdl:
    """
    cl-client
    """
    @rpc(Integer, ClientInfo, _returns = Array(ReturnedMessage))
    @core_method(category=__('Client'),title=__('Domain'),
        image='network-workgroup',
        gui=True,command='cl-client',
        rights=['domain'])
    def client(self, sid, info):
        return self.callMethod(sid,info,method_name="client",
                               logicClass=Client,
                               method="domain")
    os_install_x11_video_drv = String
    os_install_x11_resolution = String
    os_install_x11_composite = Boolean
    os_install_fb_resolution = String

    cl_autopartition_device = Array(String)
    cl_autopartition_scheme = Array(String)
    cl_autopartition_set = Boolean
    cl_autopartition_table = String
    cl_autopartition_root_size = String

    cl_live = Boolean
    os_install_pxe = Boolean
    os_install_pxe_path = String

installCatchExcept = catchExcept(VariableError,DataVarsError,
                                 cl_install.InstallError)

class Wsdl:
    from calculate.core.server.baseClass import Basic
    from calculate.core.server.decorators import Dec

    @rpc(Integer, InstallInfo, _returns = Array(ReturnedMessage))
    @core_method(category=__('Installation'),title=__("System install"),
        image='calculate-install,system-installer,applications-other,'
              'drive-harddisk',
        gui=True,command='cl-install',
        rights=['install'])
    def install ( self, sid, info):
        return self.callMethod(sid,info,logicClass=cl_install.Install,
                               method="installSystem",method_name="install",
                               callbackRefresh=self.fixInstallLocalization)
import cl_desktop
from calculate.lib.cl_lang import setLocalTranslate,getLazyLocalTranslate
from calculate.core.server.decorators import Dec
from calculate.core.server.func import catchExcept
core_method = Dec.core_method
setLocalTranslate('cl_desktop3',sys.modules[__name__])
import traceback
from functools import wraps,WRAPPER_ASSIGNMENTS

__ = getLazyLocalTranslate(_)

class DesktopInfo(CommonInfo):
    """Parameters for method install"""
    ur_login = String

desktopCatchExcept = catchExcept(VariableError,DataVarsError,
                                 cl_desktop.DesktopError)

class Wsdl:
    """
    cl-desktop
    """
    @rpc(Integer, DesktopInfo, _returns = Array(ReturnedMessage))
    @core_method(category=__('Desktop'),title=__('Configure user'),
        image='user-desktop,preferences-desktop',
        gui=True,command='cl-desktop',
        rights=['userconfigure'])
    def desktop(self, sid, info):
        return self.callMethod(sid,info,method_name="desktop",
                               logicClass=Desktop,
                               method="createHome")