2
2
from h5xplorer .menu_tools import *
3
3
from h5xplorer .menu_plot import *
4
4
5
- def default_context_menu (self , treeview , position ):
6
5
6
+ def default_context_menu (self , treeview , position ):
7
7
"""Generate a right-click menu for the items"""
8
8
9
- all_item = get_current_item (self ,treeview ,single = False )
9
+ all_item = get_current_item (self , treeview , single = False )
10
10
11
11
if len (all_item ) == 1 :
12
12
13
13
item = all_item [0 ]
14
- data = get_group_data (get_current_hdf5_group (self ,item ))
14
+ data = get_group_data (get_current_hdf5_group (self , item ))
15
15
16
16
if data is None :
17
17
list_operations = ['Print attrs' ]
18
18
19
19
elif data .ndim == 1 :
20
- list_operations = ['Print attrs' ,'-' ,'Plot Hist' , 'Plot Line' ]
20
+ list_operations = ['Print attrs' ,
21
+ '-' , 'Plot Hist' , 'Plot Line' ]
21
22
22
23
elif data .ndim == 2 :
23
- list_operations = ['Print attrs' ,'-' ,'Plot Hist' , 'Plot Map' ]
24
+ list_operations = ['Print attrs' ,
25
+ '-' , 'Plot Hist' , 'Plot Map' ]
24
26
25
27
else :
26
28
list_operations = ['Print attrs' ]
27
29
28
- action ,actions = get_actions (treeview ,position ,list_operations )
30
+ action , actions = get_actions (
31
+ treeview , position , list_operations )
29
32
30
33
if action == actions ['Print attrs' ]:
31
- send_dict_to_console (self ,item ,treeview )
34
+ send_dict_to_console (self , item , treeview )
32
35
33
36
if 'Plot Hist' in actions :
34
37
if action == actions ['Plot Hist' ]:
35
- plot_histogram (self ,item ,treeview )
38
+ plot_histogram (self , item , treeview )
36
39
37
40
if 'Plot Line' in actions :
38
41
if action == actions ['Plot Line' ]:
39
- plot_line (self ,item ,treeview )
42
+ plot_line (self , item , treeview )
40
43
41
44
if 'Plot Map' in actions :
42
45
if action == actions ['Plot Map' ]:
43
- plot2d (self ,item ,treeview )
46
+ plot2d (self , item , treeview )
44
47
45
48
elif len (all_item ) == 2 :
46
49
47
- item0 ,item1 = all_item
50
+ item0 , item1 = all_item
48
51
49
- list_operations = ['Plot Scatter' ,'Plot Line' ]
50
- action ,actions = get_actions (treeview ,position ,list_operations )
52
+ list_operations = ['Plot Scatter' , 'Plot Line' ]
53
+ action , actions = get_actions (
54
+ treeview , position , list_operations )
51
55
52
56
if action == actions ['Plot Scatter' ]:
53
- plot1D (self ,item0 ,item1 ,treeview ,plot = 'scatter' )
57
+ plot1D (self , item0 , item1 , treeview , plot = 'scatter' )
54
58
55
59
if action == actions ['Plot Line' ]:
56
- plot1D (self ,item0 ,item1 ,treeview ,plot = 'line' )
60
+ plot1D (self , item0 , item1 , treeview , plot = 'line' )
0 commit comments