mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2026-09-03 20:52:56 -05:00
makeapi: optimize API.txt
Change Param formatting to: * always use quantified names rather than the `required` and `multivalue` kwargs, * ignore kwargs with default value, * ignore kwargs related to validation, as validation is now strictly server-side, * ignore the `attribute` and `primary_key` kwargs, as they are relevant only on object params, * ignore the `include` and `exclude` kwargs, as makeapi takes into account only params available in the 'cli' context, * ignore the unused `csv` kwarg. Format optional Output arguments as kwargs. https://fedorahosted.org/freeipa/ticket/4739 Reviewed-By: David Kupka <dkupka@redhat.com>
This commit is contained in:
@@ -44,18 +44,40 @@ API_NO_FILE = 4
|
||||
API_DOC_ERROR = 8
|
||||
|
||||
# attributes removed from Param.__kw dictionary
|
||||
PARAM_IGNORED_KW_ATTRIBUTES = ('label',
|
||||
'doc',
|
||||
'normalizer',
|
||||
'default_from',
|
||||
'hint',
|
||||
'flags',
|
||||
'sortorder',
|
||||
'pattern_errmsg',)
|
||||
PARAM_IGNORED_KW_ATTRIBUTES = (
|
||||
'attribute',
|
||||
'csv',
|
||||
'default_from',
|
||||
'doc',
|
||||
'exclude',
|
||||
'exponential',
|
||||
'flags',
|
||||
'hint',
|
||||
'include',
|
||||
'label',
|
||||
'length',
|
||||
'maxlength',
|
||||
'maxvalue',
|
||||
'minlength',
|
||||
'minvalue',
|
||||
'noextrawhitespace',
|
||||
'normalizer',
|
||||
'numberclass',
|
||||
'only_absolute',
|
||||
'only_relative',
|
||||
'pattern',
|
||||
'pattern_errmsg',
|
||||
'precision',
|
||||
'primary_key',
|
||||
'query',
|
||||
'sortorder',
|
||||
)
|
||||
|
||||
# attributes removed from Output object
|
||||
OUTPUT_IGNORED_ATTRIBUTES = ('doc',
|
||||
'flags',)
|
||||
OUTPUT_IGNORED_ATTRIBUTES = (
|
||||
'doc',
|
||||
'flags',
|
||||
)
|
||||
|
||||
def parse_options():
|
||||
from optparse import OptionParser
|
||||
|
||||
Reference in New Issue
Block a user