Hi Everyone,
Genesis2 r11012 is out. As usual, default on Stanford machines and send me an email to get a tar ball elsewhere :-)
Genesis2.XMLCrawler Python Module
Error and Warning now called as both method and as function
-
sub error
- Prints an error message and exits with a printout of the current file and line number. Can be used as either function or method.
//; $self->error("some error message");
//; error("some error message");
- sub warning
- Prints a warning message and a printout of the current file and line. Does NOT exit. Can be used as either function or method.
//; $self->warning("some message");
//; warning("some message");
Style Tip For Parameter Definitions
- Often, we would like to declare a parameter that MUST be overridden at instantiation or from external configuration. One way to do that is to provide a default value which is out of range. If the parameter value is not overridden, Genesis will issue an error. For example:
//; my $width = parameter(Name=>'BitWidth', Val=>-1, Min=>0, Doc=>'...');
//; my $enc = parameter(Name=>'Encrypt ', Val=>'', List=>['Yes', 'No', 'Maybe'], Doc=>'...');
-
For compound structures and/or pointers, where simple range limitations could not apply, the following is useful:
//; my $cpu_ref = parameter(Name=>'CPU_ObjRef', Val=>undef, Doc=>'...') or error ("Parameter CPU_ObjRef must be specified");
As always, shoot me an email if you see a bug or think about a cool feature you would like to see in your generator.
Best,
Ofer.