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:
Jan Cholasta
2016-05-25 16:06:26 +02:00
parent ac2e9e84cf
commit 77e27de147
4 changed files with 4744 additions and 4683 deletions
+32 -10
View File
@@ -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