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.
calculate-utils-2.2-assemble/pym/cl_assemble_cmd.py

56 lines
2.1 KiB

#-*- 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_assemble import cl_assemble, __app__, __version__
from cl_opt import opt
from cl_share_cmd import share_cmd
import os
from os import path, access, R_OK
import re
import sys
from cl_lang import lang
lang().setLanguage(sys.modules[__name__])
DESCRIPTION = _("The Calculate Linux system assemble")
CMD_OPTIONS = [{'shortOption':"f",
'longOption':"force",
'help':_("no questions during the creating process")
}]
USAGE = _("%prog [options]")
class assemble_cmd(share_cmd):
"""Class for work with cl_assemble by console"""
def __init__(self):
self.optobj = opt(package=__app__,
version=__version__,
description=DESCRIPTION,
usage=USAGE,
option_list= CMD_OPTIONS + opt.variable_control +
opt.color_control,
check_values=self.checkOpts)
self.logicObj = cl_assemble()
#self.optionsInitrdIncompatible = ["o","no_clean","m","mdadm","lvm",
# "k", "e","dmraid","c","ebuild",
# "symlink"]
def checkOpts(self, values, args):
"""Check values all specified options."""
if len(args) > 0:
self.optobj.error(_("unrecognized option") + ": %s"% "".join(args))
self.optobj.checkVarSyntax(values)
return (values, args)