chiark
/
gitweb
/
~yarrgweb
/
ypp-sc-tools.main.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
printable trading plans
[ypp-sc-tools.main.git]
/
yarrg
/
CommodsWeb.pm
diff --git
a/yarrg/CommodsWeb.pm
b/yarrg/CommodsWeb.pm
index 0f3f43df8fd236975a57ef5310cccdbf4f14b25f..37bbfe7dcbcc2d878eb5a2d7016458b616358e35 100644
(file)
--- a/
yarrg/CommodsWeb.pm
+++ b/
yarrg/CommodsWeb.pm
@@
-50,7
+50,7
@@
BEGIN {
@ISA = qw(Exporter);
@EXPORT = qw(&dbw_connect &dbw_filename &ocean_list &sourcebasedir
&to_json_shim &to_json_protecttags
@ISA = qw(Exporter);
@EXPORT = qw(&dbw_connect &dbw_filename &ocean_list &sourcebasedir
&to_json_shim &to_json_protecttags
- &set_ctype_utf8 &webdatadir
+ &set_ctype_utf8 &webdatadir
&printable
&expected_error &dbw_lookup_string
&prettyprint_age &meta_prettyprint_age);
%EXPORT_TAGS = ( );
&expected_error &dbw_lookup_string
&prettyprint_age &meta_prettyprint_age);
%EXPORT_TAGS = ( );
@@
-200,6
+200,15
@@
sub expected_error ($) {
die $r;
}
die $r;
}
+sub printable ($) { # printable($m) where $m is the Mason request object
+ my ($m) = @_;
+ my $a= scalar $m->caller_args(-1);
+ foreach my $t (qw(pdf ps html)) {
+ return $t if $a->{"printable_$t"};
+ }
+ return 0;
+}
+
package CommodsWeb::ExpectedError;
sub emsg ($) {
package CommodsWeb::ExpectedError;
sub emsg ($) {