rev 1299 - trunk/mariachi

[prev] [thread] [next] [lurker] [Date index for 2003/08/10]

From: richardc
Subject: rev 1299 - trunk/mariachi
Date: 01:03 on 10 Aug 2003
Author: richardc
Date: 2003-08-10 01:03:16 +0100 (Sun, 10 Aug 2003)
New Revision: 1299

Modified:
   trunk/mariachi/mariachi
Log:
dynamically load a Mariachi subclass (for when tweaking templates just ain't enough)


Modified: trunk/mariachi/mariachi
===================================================================
--- trunk/mariachi/mariachi	2003-08-08 13:26:03 UTC (rev 1298)
+++ trunk/mariachi/mariachi	2003-08-10 00:03:16 UTC (rev 1299)
@@ -1,6 +1,5 @@
 #!/usr/local/bin/perl -w
 use strict;
-use Mariachi;
 use AppConfig qw(:argcount);
 
 =head1 NAME
@@ -159,7 +158,19 @@
     VALIDATE => sub { $context_styles{ $_[1] } }
    });
 
+=head2 --class I<class>
 
+Specifies using a class other than C<Mariachi> to do the rendering.
+
+=cut
+
+$config->define("class", {
+    DEFAULT => 'Mariachi',
+    ARGCOUNT => ARGCOUNT_ONE,
+    VALIDATE => sub { eval "require $_[1]; 1" }
+   });
+
+
 # define the system and the user config files
 my $sys  = "/usr/local/mariachi/mariachi.conf";
 my $user = "$ENV{HOME}/.mariachi";
@@ -190,9 +201,9 @@
     $config->name("no list name");
 }
 
-Mariachi->new( config  => $config,
-               threads_per_page => 20,
-              )
+$config->class->new( config  => $config,
+                     threads_per_page => 20,
+                    )
   ->perform;
 
 

Generated at 13:57 on 01 Jul 2004 by mariachi 0.52