def parameters(cls, sort=True, as_strings=False):
        """
        Return a list of tuples ``(field, description, type, default)``,
        one for each field of the configuration.

        :param bool sort: if ``True``, return the list sorted by field
        :param bool as_strings: if ``True``, return formatted strings instead
        :rtype: list
        """
        def cft(ftype, fdefault):
            """ Convert field type and default value to string """
            if ftype is None:
                return u""
            if ftype in [TimeValue, Decimal, float]:
                cftype = u"float"
                cfdefault = u"%.3f" % ftype(fdefault) if fdefault is not None else u"None"
            elif ftype == int:
                cftype = u"int"
                cfdefault = u"%d" % ftype(fdefault) if fdefault is not None else u"None"
            elif ftype == bool:
                cftype = u"bool"
                cfdefault = u"%s" % fdefault if fdefault is not None else u"None"
            else:
                cftype = u"unknown"
                cfdefault = u"%s" % fdefault if fdefault is not None else u"None"
            return u" (%s, %s)" % (cftype, cfdefault)

        parameters = [(field, fdesc, ftype, fdefault) for (field, (fdefault, ftype, faliases, fdesc)) in cls.FIELDS]
        if sort:
            parameters = sorted(parameters)
        if as_strings:
            l = max([len(t[0]) for t in parameters])
            parameters = [u"%s : %s%s" % (f.ljust(l), d, cft(t, df)) for (f, d, t, df) in parameters]
        return parameters
def parameters ( cls , sort = True , as_strings = False ) : def cft ( ftype , fdefault ) : if ftype is None : return u"" if ftype in [ TimeValue , Decimal , float ] : cftype = u"float" cfdefault = u"%.3f" % ftype ( fdefault ) if fdefault is not None else u"None" elif ftype == int : cftype = u"int" cfdefault = u"%d" % ftype ( fdefault ) if fdefault is not None else u"None" elif ftype == bool : cftype = u"bool" cfdefault = u"%s" % fdefault if fdefault is not None else u"None" else : cftype = u"unknown" cfdefault = u"%s" % fdefault if fdefault is not None else u"None" return u" (%s, %s)" % ( cftype , cfdefault ) parameters = [ ( field , fdesc , ftype , fdefault ) for ( field , ( fdefault , ftype , faliases , fdesc ) ) in cls . FIELDS ] if sort : parameters = sorted ( parameters ) if as_strings : l = max ( [ len ( t [ 0 ] ) for t in parameters ] ) parameters = [ u"%s : %s%s" % ( f . ljust ( l ) , d , cft ( t , df ) ) for ( f , d , t , df ) in parameters ] return parameters
Return a list of tuples ``(field, description, type, default)``,
        one for each field of the configuration.

        :param bool sort: if ``True``, return the list sorted by field
        :param bool as_strings: if ``True``, return formatted strings instead
        :rtype: list