lib/App/SeismicUnixGui/misc/error.pm untested

filter: Statementstmt 0.0% 0 / 23 Branchbran 0.0% 0 / 6 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 4 Podpod 0.0% 0 / 3 totaltotal 0.0% 0 / 36 CC 4 SCAR 16.9
CC
4
Cov
0%
run_flow
6.0
save_superflow
6.0
save_flow
6.0
CRAP 5.4
1 package App::SeismicUnixGui::misc::error;
2 use Moose;
3 our $VERSION = '0.0.1';
4  
5 =head2 sub run_flow
6  
7 Deals with GUI-made flows
8 Running *.pl file
9  
10 =cut
11  
12 sub run_flow {
13 my ( $self, $hash_ref ) = @_;
14 if ( $hash_ref->{_flow_name} ) {
15 $hash_ref->{_error} = 0;
16 }
17 else {
18 my $message = ("Save flow first. Then run.\n");
19 print $message;
20  
21 #$hash_ref->{_message}->insert('end', "Thi is some normal text\n");
22 return (0);
23 }
24 return ();
25 }
26  
27 =head2 sub save_superflow
28  
29 i/p: hash_ref
30  
31 Deal with macros
32 - error to superflow file:
33 - error to a *.config file
34  
35 DB:
36 print("error_button,error,superflow, current widget is $name->{_current_widget}\n");
37 print("2. current program name is $name->{_prog_name}\n");
38  
39 =cut
40  
41 sub save_superflow {
42 my ( $self, $hash_ref ) = @_;
43 if ( $hash_ref->{_superflow_name} ) {
44 $hash_ref->{_error} = 0;
45 }
46 else {
47 print("error,nameless superflow\n");
48 return (0);
49 }
50 return ();
51 }
52  
53 =head2 sub save_flow
54  
55 Deals with GUI-made flows
56 Save to a *.pl file
57  
58 =cut
59  
60 sub save_flow {
61 my ( $self, $hash_ref ) = @_;
62 if ( $hash_ref->{_flow_name} ) {
63 $hash_ref->{_error} = 0;
64 }
65 else {
66 print("error,nameless flow,TODO\n");
67 return (0);
68 }
69 return ();
70 }
71 1;