Exemple #1
0
    def mark_unmanaged(self):
        # we are already unmanaged.
        if not self.is_managed():
            return True

        # else we need to be added
        managed_packs = get_config("setup::unmanaged").split(",")
        managed_packs.append(self.name)

        # and store it.
        set_config("setup::unmanaged", ",".join(managed_packs))
        return True
Exemple #2
0
    def mark_managed(self):
        # we are already managed.
        if self.is_managed():
            return True

        # else we need to be removed
        managed_packs = get_config("setup::unmanaged").split(",")
        while self.name in managed_packs:
            managed_packs.remove(self.name)

        # and store it.
        set_config("setup::unmanaged", ",".join(managed_packs))
        return True
Exemple #3
0
def do(args, unknown):
    if args.reset_all:
        try:
            os.remove(config.config_file)
            return True
        except:
            pass
        return False

    if args.reset:
        if args.key == None:
            err("Missing key. ")
            return False
        try:
            return config.reset_config(args.key)
        except:
            pass
        return False

    if args.key == None:
        config.list_config()
        std()
        std("Type 'lmh config KEY' to get more information on KEY. ")
        std("Type 'lmh config KEY VALUE' to change KEY to VALUE. ")
        return True
    elif args.value == None:
        return config.get_config_help(args.key)
    else:
        try:
            return config.set_config(args.key, args.value)
        except:
            pass
        return False
Exemple #4
0
def do(args, unknown):
    if args.reset_all:
        try:
            os.remove(config.config_file)
            return True
        except:
            pass
        return False

    if args.reset:
        if args.key == None:
            err("Missing key. ")
            return False
        try:
            return config.reset_config(args.key)
        except:
            pass
        return False

    if args.key == None:
        config.list_config()
        std()
        std("Type 'lmh config KEY' to get more information on KEY. ")
        std("Type 'lmh config KEY VALUE' to change KEY to VALUE. ")
        return True
    elif args.value == None:
        return config.get_config_help(args.key)
    else:
        try:
            return config.set_config(args.key, args.value)
        except:
            pass
        return False