Exemplo n.º 1
0
    def init_and_get_unknowns(cls, args=None):
        """ Initializes but also returns unknowns.

         For the desired philosophy of returning parameters all the time,
         try to avoid this function, e.g. parse outside parameters first.
         """
        opt, rest_args = split_arguments(args, cls.get_instance_parameters())
        return cls(opt), rest_args
Exemplo n.º 2
0
    def init_and_get_unknowns(cls, args=None):
        """ Initializes but also returns unknowns.

         For the desired philosophy of returning parameters all the time,
         try to avoid this function, e.g. parse outside parameters first.
         """
        opt, rest_args = split_arguments(args, cls.get_instance_parameters())
        return cls(opt), rest_args
Exemplo n.º 3
0
def get_accel_class_from_args(args=None):
    """ LEGACY-FUNCTION SHOULD BE REPLACED BY USING get_accel_class """
    parser = EntryPoint(_get_params())
    opt, class_args = parser.parse(args)

    accel = _get_parent_class(opt.accel)

    accel_args, rest_args = split_arguments(class_args, accel.get_class_parameters())
    accel_cls = accel.get_class(accel_args)
    return accel_cls, rest_args
Exemplo n.º 4
0
def get_accel_class_from_args(args=None):
    """ LEGACY-FUNCTION SHOULD BE REPLACED BY USING get_accel_class """
    parser = EntryPoint(_get_params())
    opt, class_args = parser.parse(args)

    accel = _get_parent_class(opt.accel)

    accel_args, rest_args = split_arguments(class_args, accel.get_class_parameters())
    accel_cls = accel.get_class(accel_args)
    return accel_cls, rest_args