def validate_args(cls, *args, **kwargs): # Don't allow mixed *RQ and *RS in the same OFX if not all_equal(key[-7:] for key in kwargs): msg = "{}: mixed *MSGRQV1 and *MSGSRSV1 are invalid" raise ValueError(msg.format(cls.__name__)) super().validate_args(*args, **kwargs)
def validate_args(cls, *args, **kwargs): # Don't allow mixed *RQ and *RS in the same OFX if not all_equal(key[-7:] for key in kwargs): msg = f"{cls.__name__}: mixed *MSGRQV1 and *MSGSRSV1 are invalid" raise ValueError(msg) super().validate_args(*args, **kwargs)
def validate_args(cls, *args, **kwargs): """ Specify either <xxxPCT> or <xxxAMT>. The new contributions to each security are either all specified by a percentage of contributions or by a fixed dollar amount, but not both. At least one source must be provided. """ if not all_equal(key[-3:] for key in kwargs if key != "secid"): msg = "{}: mixed *PCT and *AMT are invalid" raise ValueError(msg.format(cls.__name__)) if len(kwargs) < 2: msg = "{}: at least one source must be provided" raise ValueError(msg.format(cls.__name__)) super().validate_args(*args, **kwargs)