Skip to content

Commit 94dfb4b

Browse files
Internal: Remove ability to export to csv directly from sharedTasksCSV ireport #4862 [autosync]
1 parent 0547172 commit 94dfb4b

2 files changed

Lines changed: 14 additions & 9 deletions

File tree

Solutions/sharedTasks/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Calls graphs with global objects are useful for finding all global objects accessed by a call tree. But, what if you want to find which global objects are shared between multiple call trees? The shared tasks plugins find global objects accessed from multiple call trees.
44

5-
The plugin [sharedTasksGraph.upy](https://raw.githubusercontent.com/stinb/plugins/main/Solutions/sharedTasks/sharedTasksGraph.upy) displays all the call trees and objects in a single graph, highlighting global objects that are accessed from multiple root functions. The plugin [sharedTasksObjectGraph.upy](https://raw.githubusercontent.com/stinb/plugins/main/Solutions/sharedTasks/sharedTasksObjectGraph.upy) does is the reverse - it starts from objects and goes to root functions. The plugin [sharedTasksCSV.upy](https://raw.githubusercontent.com/stinb/plugins/main/Solutions/sharedTasks/sharedTasksCSV.upy) displays each reference in a table in an interactive report. It can also export a CSV file at the same time as the interactive report or when run directly from the command line.
5+
The plugin [sharedTasksGraph.upy](https://raw.githubusercontent.com/stinb/plugins/main/Solutions/sharedTasks/sharedTasksGraph.upy) displays all the call trees and objects in a single graph, highlighting global objects that are accessed from multiple root functions. The plugin [sharedTasksObjectGraph.upy](https://raw.githubusercontent.com/stinb/plugins/main/Solutions/sharedTasks/sharedTasksObjectGraph.upy) does is the reverse - it starts from objects and goes to root functions. The plugin [sharedTasksCSV.upy](https://raw.githubusercontent.com/stinb/plugins/main/Solutions/sharedTasks/sharedTasksCSV.upy) displays each reference in a table in an interactive report. It can also export a CSV file when run directly from the command line.
66

77
![image](.doc/338366919-ff1f01b2-4970-4c34-ad12-ada42ee13c22.png)
88

@@ -49,10 +49,10 @@ There are a lot of options for building an architecture:
4949

5050
# Exports
5151

52-
The interactive report plugin can be used to generate a CSV file while running the report or from the command line.
52+
The interactive report plugin can be used to generate a CSV file from the command line.
5353

5454
```sh
55-
upython sharedTasksCSV.upy -h
55+
upython sharedTasksCSV.py -h
5656
```
5757

58-
To have a dynamic file name, you can add {arch}, {date}, or {time} (case-insensitive) to the "CSV file name" option (IReport) or `-csvFileName` argument (command line)
58+
To have a dynamic file name, you can add {arch}, {date}, or {time} (case-insensitive) to the `-csvFileName` command-line argument.

Solutions/sharedTasks/sharedTasksCSV.upy

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
# Command line interface for creating a CSV of an architecture of shared tasks
1+
# Interactive report listing objects accessed from multiple call trees, with
2+
# one row per task/function/object reference. Use the report's built-in CSV
3+
# export (GUI export button or `und report -format csv`) to save the table to
4+
# disk.
25

36

47
from sharedTasksCSV import *
@@ -8,7 +11,7 @@ def name() -> str:
811
return 'Shared Tasks CSV'
912

1013
def description():
11-
return '''Export a CSV report of objects accessed from multiple call trees.
14+
return '''Interactive report of objects accessed from multiple call trees.
1215

1316
<p>Architectures are used to tag the root functions defining the call trees.
1417
This report runs on such architectures to highlight global objects accessed
@@ -90,7 +93,7 @@ def test_architecture(arch: Arch) -> bool:
9093

9194

9295
def init(report: ReportContext):
93-
for option in CSV_OPTIONS:
96+
for option in COMMON_OPTIONS:
9497
# Checkbox
9598
if option.choices == OPTION_BOOL_CHOICES:
9699
report.options().checkbox(option.key, option.name, option.default == OPTION_BOOL_TRUE)
@@ -105,11 +108,13 @@ def init(report: ReportContext):
105108
def generate(report: ReportContext, target: Arch | Ent | Db):
106109
# Options
107110
options = dict() # type: dict[str, str | bool]
108-
for option in CSV_OPTIONS:
111+
for option in COMMON_OPTIONS:
109112
value = report.options().lookup(option.key)
110113
if option.choices == OPTION_DEPTH_CHOICES and value != 'All':
111114
value = int(value)
112115
options[option.key] = value
116+
# Suppress the on-disk CSV path in generateCSV(); rely on the GUI/CLI
117+
# CSV export of the rendered table instead.
118+
options[AUTO_EXPORT] = False
113119

114-
# Export file and print lines to report
115120
generateCSV(report.db(), target, options, report)

0 commit comments

Comments
 (0)