(target, seen, text, options = {})
| 645 | } |
| 646 | |
| 647 | function appendPythonScripts(target, seen, text, options = {}) { |
| 648 | extractPythonBlocks(text).forEach((block) => { |
| 649 | const scriptText = String(block.text || '').trim(); |
| 650 | if (!scriptText || seen.has(scriptText)) { |
| 651 | return; |
| 652 | } |
| 653 | seen.add(scriptText); |
| 654 | const order = target.length + 1; |
| 655 | target.push({ |
| 656 | id: (options.idPrefix || 'python-script') + '-' + order, |
| 657 | order, |
| 658 | title: block.title || options.title || 'Python script ' + order, |
| 659 | text: scriptText, |
| 660 | sections: [makeCodeSection(scriptText, 'python', 'Python')], |
| 661 | timeLabel: options.timeLabel || 'n/a', |
| 662 | sourceLabel: options.sourceLabel || block.sourceLabel || '', |
| 663 | chips: uniqueStrings([options.sourceLabel || block.sourceLabel || 'python'].concat(options.chips || [])) |
| 664 | }); |
| 665 | }); |
| 666 | } |
| 667 | |
| 668 | function extractActionPayload(record, action = null) { |
| 669 | const source = record && typeof record === 'object' ? record : {}; |
no test coverage detected