You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
48 lines
1.5 KiB
48 lines
1.5 KiB
12 years ago
|
#-*- coding: utf-8 -*-
|
||
|
|
||
11 years ago
|
# Copyright 2008-2013 Calculate Ltd. http://www.calculate-linux.org
|
||
12 years ago
|
#
|
||
|
# 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
|
||
12 years ago
|
from calculate.lib.datavars import (Variable,VariableError,ReadonlyVariable,
|
||
|
ActionVariable)
|
||
12 years ago
|
|
||
|
from calculate.lib.cl_lang import setLocalTranslate
|
||
|
setLocalTranslate('cl_desktop3',sys.modules[__name__])
|
||
|
|
||
12 years ago
|
class VariableAcDesktopMerge(ActionVariable):
|
||
12 years ago
|
"""
|
||
12 years ago
|
Action variable which has value "on" for install calculate-desktop
|
||
12 years ago
|
and "down" for uninstall
|
||
|
"""
|
||
12 years ago
|
nonchroot = True
|
||
12 years ago
|
|
||
|
def action(self,cl_action):
|
||
|
if cl_action == "merge":
|
||
|
return "on"
|
||
|
return "off"
|
||
|
|
||
|
class VariableAcDesktopProfile(ActionVariable):
|
||
12 years ago
|
"""
|
||
12 years ago
|
Action variable which has value "on" on user profile setup
|
||
12 years ago
|
"""
|
||
12 years ago
|
nonchroot = True
|
||
12 years ago
|
|
||
|
def action(self,cl_action):
|
||
|
if cl_action in ("desktop",):
|
||
|
return "on"
|
||
|
return "off"
|