(a, var)
| 340 | |
| 341 | |
| 342 | def getpydocsign(a, var): |
| 343 | global lcb_map |
| 344 | if isfunction(var): |
| 345 | if 'result' in var: |
| 346 | af = var['result'] |
| 347 | else: |
| 348 | af = var['name'] |
| 349 | if af in var['vars']: |
| 350 | return getpydocsign(af, var['vars'][af]) |
| 351 | else: |
| 352 | errmess('getctype: function %s has no return value?!\n' % af) |
| 353 | return '', '' |
| 354 | sig, sigout = a, a |
| 355 | opt = '' |
| 356 | if isintent_in(var): |
| 357 | opt = 'input' |
| 358 | elif isintent_inout(var): |
| 359 | opt = 'in/output' |
| 360 | out_a = a |
| 361 | if isintent_out(var): |
| 362 | for k in var['intent']: |
| 363 | if k[:4] == 'out=': |
| 364 | out_a = k[4:] |
| 365 | break |
| 366 | init = '' |
| 367 | ctype = getctype(var) |
| 368 | |
| 369 | if hasinitvalue(var): |
| 370 | init, showinit = getinit(a, var) |
| 371 | init = ', optional\\n Default: %s' % showinit |
| 372 | if isscalar(var): |
| 373 | if isintent_inout(var): |
| 374 | sig = '%s : %s rank-0 array(%s,\'%s\')%s' % (a, opt, c2py_map[ctype], |
| 375 | c2pycode_map[ctype], init) |
| 376 | else: |
| 377 | sig = '%s : %s %s%s' % (a, opt, c2py_map[ctype], init) |
| 378 | sigout = '%s : %s' % (out_a, c2py_map[ctype]) |
| 379 | elif isstring(var): |
| 380 | if isintent_inout(var): |
| 381 | sig = '%s : %s rank-0 array(string(len=%s),\'c\')%s' % ( |
| 382 | a, opt, getstrlength(var), init) |
| 383 | else: |
| 384 | sig = '%s : %s string(len=%s)%s' % ( |
| 385 | a, opt, getstrlength(var), init) |
| 386 | sigout = '%s : string(len=%s)' % (out_a, getstrlength(var)) |
| 387 | elif isarray(var): |
| 388 | dim = var['dimension'] |
| 389 | rank = repr(len(dim)) |
| 390 | sig = '%s : %s rank-%s array(\'%s\') with bounds (%s)%s' % (a, opt, rank, |
| 391 | c2pycode_map[ |
| 392 | ctype], |
| 393 | ','.join(dim), init) |
| 394 | if a == out_a: |
| 395 | sigout = '%s : rank-%s array(\'%s\') with bounds (%s)'\ |
| 396 | % (a, rank, c2pycode_map[ctype], ','.join(dim)) |
| 397 | else: |
| 398 | sigout = '%s : rank-%s array(\'%s\') with bounds (%s) and %s storage'\ |
| 399 | % (out_a, rank, c2pycode_map[ctype], ','.join(dim), a) |
no test coverage detected