<s> """<STR_LIT>""" <EOL> from . ErrorCodes import ( <EOL> getErrorExitBoolCode , <EOL> getErrorExitCode , <EOL> getReleaseCode , <EOL> getReleaseCodes <EOL> ) <EOL> from . Helpers import generateExpressionCode <EOL> def generateCAPIObjectCodeCommon ( to_name , capi , arg_desc , may_raise , ref_count , <EOL> source_ref , emit , context , none_null = False ) : <EOL> arg_names = [ ] <EOL> for arg_name , arg_expression in arg_desc : <EOL> if arg_expression is None and none_null : <EOL> arg_names . append ( "<STR_LIT>" ) <EOL> else : <EOL> arg_name = context . allocateTempName ( arg_name ) <EOL> generateExpressionCode ( <EOL> to_name = arg_name , <EOL> expression = arg_expression , <EOL> emit = emit , <EOL> context = context <EOL> ) <EOL> arg_names . append ( arg_name ) <EOL> context . setCurrentSourceCodeReference ( source_ref ) <EOL> getCAPIObjectCode ( <EOL> to_name = to_name , <EOL> capi = capi , <EOL> arg_names = arg_names , <EOL> may_raise = may_raise , <EOL> ref_count = ref_count , <EOL> emit = emit , <EOL> context = context <EOL> ) <EOL> def generateCAPIObjectCode ( to_name , capi , arg_desc , may_raise , source_ref , emit , <EOL> context , none_null = False ) : <EOL> generateCAPIObjectCodeCommon ( <EOL> to_name = to_name , <EOL> capi = capi , <EOL> arg_desc = arg_desc , <EOL> may_raise = may_raise , <EOL> ref_count = <NUM_LIT:1> , <EOL> source_ref = source_ref , <EOL> emit = emit , <EOL> context = context , <EOL> none_null = none_null <EOL> ) <EOL> def generateCAPIObjectCode0 ( to_name , capi , arg_desc , may_raise , source_ref , <EOL> emit , context , none_null = False ) : <EOL> generateCAPIObjectCodeCommon ( <EOL> to_name = to_name , <EOL> capi = capi , <EOL> arg_desc = arg_desc , <EOL> may_raise = may_raise , <EOL> ref_count = <NUM_LIT:0> , <EOL> source_ref = source_ref , <EOL> emit = emit , <EOL> context = context , <EOL> none_null = none_null <EOL> ) <EOL> def getCAPIObjectCode ( to_name , capi , arg_names , may_raise , ref_count , emit , <EOL> context ) : <EOL> emit ( <EOL> "<STR_LIT>" % ( <EOL> to_name , <EOL> capi , <EOL> "<STR_LIT:U+002CU+0020>" . join ( arg_names ) <EOL> ) <EOL> ) <EOL> getReleaseCodes ( <EOL> release_names = ( <EOL> arg_name <EOL> for arg_name in <EOL> arg_names <EOL> if arg_name != "<STR_LIT>" <EOL> ) , <EOL> emit = emit , <EOL> context = context <EOL> ) <EOL> getErrorExitCode ( <EOL> check_name = to_name , <EOL> needs_check = may_raise , <EOL> emit = emit , <EOL> context = context <EOL> ) <EOL> if ref_count : <EOL> context . addCleanupTempName ( to_name ) <EOL> def getCAPIIntCode ( res_name , capi , args , emit , context ) : <EOL> emit ( <EOL> "<STR_LIT>" % ( <EOL> res_name , <EOL> capi , <EOL> "<STR_LIT:U+002CU+0020>" . join ( args ) <EOL> ) <EOL> ) <EOL> for arg in args : <EOL> getReleaseCode ( <EOL> release_name = arg , <EOL> emit = emit , <EOL> context = context <EOL> ) <EOL> getErrorExitBoolCode ( <EOL> condition = "<STR_LIT>" % res_name , <EOL> emit = emit , <EOL> context = context <EOL> ) <EOL> def getReferenceExportCode ( base_name , context ) : <EOL> if context . needsCleanup ( base_name ) : <EOL> return base_name <EOL> else : <EOL> return "<STR_LIT>" % base_name <EOL> def getReferenceExportCode2 ( base_name , emit , context ) : <EOL> if not context . needsCleanup ( base_name ) : <EOL> emit ( "<STR_LIT>" % base_name ) </s>
