File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1616logging .basicConfig (level = log_level )
1717logger = logging .getLogger ('generate' )
1818
19- SHARED_HEADER = '''DO NOT EDIT THIS FILE
19+ SHARED_HEADER = '''# DO NOT EDIT THIS FILE!
20+ #
21+ # This file is generated from the CDP specification. If you need to make
22+ # changes, edit the generator and regenerate all of the modules.'''
2023
21- This file is generated from the CDP specification. If you need to make changes,
22- edit the generator and regenerate all of the modules.'''
23-
24- INIT_HEADER = '''\' \' \'
25- {}
26- \' \' \'
24+ INIT_HEADER = '''{}
2725
2826''' .format (SHARED_HEADER )
2927
30- MODULE_HEADER = '''\' \' \'
31- {}
28+ MODULE_HEADER = '''{}
3229
33- Domain: {{}}
34- Experimental: {{}}
30+ \' \' \'
31+ CDP {{}} Domain {{}}
3532\' \' \'
3633
3734from cdp.util import event_class, T_JSON_DICT
@@ -730,7 +727,8 @@ def from_json(cls, domain: dict):
730727
731728 def generate_code (self ) -> str :
732729 ''' Generate the Python module code for a given CDP domain. '''
733- code = MODULE_HEADER .format (self .domain , self .experimental )
730+ exp = ' (experimental)' if self .experimental else ''
731+ code = MODULE_HEADER .format (self .domain , exp )
734732 import_code = self .generate_imports ()
735733 if import_code :
736734 code += import_code
You can’t perform that action at this time.
0 commit comments