예제 #1
0
파일: classes.py 프로젝트: KWARC/localmh
    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
예제 #2
0
파일: classes.py 프로젝트: KWARC/localmh
    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
예제 #3
0
파일: run.py 프로젝트: KWARC/localmh
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
예제 #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