Warren Smith | 1 Apr 21:24

Petal::Utils patch

This is against 0.06.

This adds several new modifiers:
count: counts items in array
dollar: formats string as us dollar amount
percent: formats string as percentage (%.2f%%)
telephone: formats strings as NANPA phone numbers 
include: include file with dynamic name

I added the tests, but it looks like the docmentation may be
auto-generated, so I didn't touch that.

Questions, comments, complaints welcome.

-Warren
diff -rN ./lib/Petal/Utils/Count.pm ../Petal-Utils-0.07/lib/Petal/Utils/Count.pm
0a1,45
> package Petal::Utils::Count;
> 
> use strict;
> use warnings::register;
> 
> use Carp;
> 
> use base qw( Petal::Utils::Base );
> 
> use constant name    => 'count';
> use constant aliases => qw();
(Continue reading)

Warren Smith | 1 Apr 21:41

Re: Petal::Utils patch

What a crappy patch. Let me try this again...

On Fri, 2005-04-01 at 13:24 -0600, Warren Smith wrote:
> This is against 0.06.
> 
> This adds several new modifiers:
> count: counts items in array
> dollar: formats string as us dollar amount
> percent: formats string as percentage (%.2f%%)
> telephone: formats strings as NANPA phone numbers 
> include: include file with dynamic name
> 
> I added the tests, but it looks like the docmentation may be
> auto-generated, so I didn't touch that.
> 
> Questions, comments, complaints welcome.
> 
> -Warren
diff -rN ./lib/Petal/Utils/Count.pm ../Petal-Utils-0.07/lib/Petal/Utils/Count.pm
0a1,45
> package Petal::Utils::Count;
> 
> use strict;
> use warnings::register;
> 
> use Carp;
> 
> use base qw( Petal::Utils::Base );
(Continue reading)

Warren Smith | 2 Apr 00:55

Petal::Application

Hey guys,

I could use some help with a code review. If you have some spare time,
please view the 440-line application framework in
lib/Petal/Application.pm and let me know what you think. It's my third
attempt at an application framework, and I've found that it works rather
nicely. There is some POD attached to show how to use it if anyone is
curious.

Any feedback is most welcome.

-Warren
Attachment (Petal-Application.tar.gz): application/x-compressed-tar, 13 KiB
William McKee | 4 Apr 21:55
Favicon

Re: Petal::Utils patch

Hi Warren,

Thanks for the patch. I'll look over tomorrow.

William

--

-- 
Knowmad Services Inc.
http://www.knowmad.com

Josh Narins | 26 Apr 01:01

Petal includes, again!

Well, at least I only have one problem :)

I've been using  
<tag tal:replace="structure include: ${content}" />

Where $content contains the name of an xml file, relative to the
template base_dir, and it works fine...

But it seems as if this doens't work recursively.

I see this in the XHTML source...

<tag tal:replace="structure include: login.xml"></tag>
Josh Narins | 26 Apr 02:48

Re: Petal includes, again!

> Well, at least I only have one problem :)
> 
> I've been using  
> <tag tal:replace="structure include: ${content}" />
> 
> Where $content contains the name of an xml file, relative to the
> template base_dir, and it works fine...
> 
> But it seems as if this doens't work recursively.
> 
> I see this in the XHTML source...
> 
> <tag tal:replace="structure include: login.xml"></tag>

I didn't mean recursively, I meant iteratively?

It doesn't seem to work if I use it in a template which I am using it
from:

main.xml:
---------
<html>
 <head><title>hi</title><head>
 <body>
  <tag tal:replace="structure include: ${is_included}"></tag>
 </body>
</html>

is_included.xml:
---------------
(Continue reading)

William McKee | 27 Apr 14:51
Favicon

Re: Petal includes, again!

On Mon, Apr 25, 2005 at 08:48:06PM -0400, Josh Narins wrote:
> It doesn't seem to work if I use it in a template which I am using it
> from:

Hi Josh,

I don't use this dynamic include but will add tests when I get time to
including Warren's submissions into Petal::Utils. Are you using the same
code as he posted earlier this month? Also, have you tried doing the
includes without the structure keyword? I'm curious to know if that
changes Petal's behavior.

William

--

-- 
Knowmad Services Inc.
http://www.knowmad.com

Josh Narins | 28 Apr 17:26

Re: Petal includes, again!

I accidentally sent this only to William.

I am using the same code, and removing the structure keyword didn't
change it.

> On Mon, Apr 25, 2005 at 08:48:06PM -0400, Josh Narins wrote:
> > It doesn't seem to work if I use it in a template which I am using it
> > from:
> 
> Hi Josh,
> 
> I don't use this dynamic include but will add tests when I get time to
> including Warren's submissions into Petal::Utils. Are you using the same
> code as he posted earlier this month? Also, have you tried doing the
> includes without the structure keyword? I'm curious to know if that
> changes Petal's behavior.
> 
> 
> William
> 
> -- 
> Knowmad Services Inc.
> http://www.knowmad.com
Josh Narins | 28 Apr 17:27

true: a && b


I was wondering how to do this.

true:/a && /b

TIA,
Josh
Josh Narins | 28 Apr 20:23

Re: true: a && b


Ah, man Petal::Utils

and:  /a /b

> 
> I was wondering how to do this.
> 
> true:/a && /b
> 
> TIA,
> Josh


Gmane