[Catalyst] Cooked up another patch to Catalyst::View::Email.

2007-08-30 Thread Evan Carroll
In another attempt to eliminate obnoxious silent assumptions and
silent erroring, I present another patch. Enjoy.

diff --git a/Email.pm b/Email.pm
index 7fa09dc..5744a11 100644
--- a/Email.pm
+++ b/Email.pm
@@ -1,6 +1,6 @@
 package Catalyst::View::Email;

-use warnings;
+use warnings::register;
 use strict;

 use Class::C3;
@@ -13,7 +13,7 @@ use base qw|Catalyst::View|;

 our $VERSION = '0.06';

-__PACKAGE__-mk_accessors(qw(sender stash_key content_type mailer));
+__PACKAGE__-mk_accessors(qw(sender stash_key content_type mailer
mailer_method));

 =head1 NAME

@@ -121,17 +121,42 @@ sub new {

 my $mailer = Email::Send-new;

-if ( my $method = $self-sender-{method} ) {
-croak $method is not supported, see Email::Send
-unless $mailer-mailer_available($method);
-$mailer-mailer($method);
-} else {
-# Default case, run through the most likely options first.
-for ( qw/SMTP Sendmail Qmail/ ) {
-$mailer-mailer($_) and last if $mailer-mailer_available($_);
+my $chosen_method; ## get the chosen_method;
+if ( $chosen_method ||= $self-sender-{method} ) {
+  croak $chosen_method is not supported, see Email::Send
+. \n\tOther installed options might include: [
@{[$mailer-all_mailers]} ]
+unless $mailer-mailer_available($chosen_method);
+}
+else {
+
+  foreach my $default_method ( qw/SMTP Sendmail Qmail/ ) {
+
+if ( $mailer-mailer_available($default_method) ) {
+
+  $chosen_method = $default_method;
+
+  warnings::warnif( 'Warning: ' . __PACKAGE__
+.  is making assumption that $default_method is the
desired method
+. \n\tOther installed options might include: [
@{[$mailer-all_mailers]} ]
+  );
+
+  last;
+
 }
+
+  }
+
+croak 'You have neither specified a valid ' . __PACKAGE__ . ' method'
+. ' nor could one be found in our suggested list'
+. \n\tOther installed options might include: [
@{[$mailer-all_mailers]} ]
+unless $chosen_method;
+
 }

+$mailer-mailer( $chosen_method );
+
+$self-mailer_method( $chosen_method );
+
 if ( my $args = $self-sender-{mailer_args} ) {
 if ( ref $args eq 'HASH' ) {
 $mailer-mailer_args([ %$args ]);
@@ -190,7 +215,10 @@ sub process {
 my $message = Email::MIME-create(%mime);

 if ( $message ) {
-$self-mailer-send($message);
+  my $resp = $self-mailer-send($message);
+  croak SMTP is dieing caught with Email::Send::SMTP specific code $resp
+if $self-mailer_method eq 'SMTP' and !$resp
+  ;
 } else {
 croak Unable to create message;
 }


-- 
Evan Carroll
System Lord of the Internets
[EMAIL PROTECTED]
832-445-8877

___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/


[Catalyst] Re: Cooked up another patch to Catalyst::View::Email.

2007-08-30 Thread Evan Carroll
It just occurred to me, that i forgot to tell you what it does:

we now capture the mailer-method
all around more verbose error output now with suggestions
if warnings are enabled makes user aware of assumptions
   - if not just run -X like you should damn well be doing
 in production code.
much much more verbose checking on SMTP, we now check
 the status of the send


On 8/30/07, Evan Carroll [EMAIL PROTECTED] wrote:
 In another attempt to eliminate obnoxious silent assumptions and
 silent erroring, I present another patch. Enjoy.

 diff --git a/Email.pm b/Email.pm
 index 7fa09dc..5744a11 100644
 --- a/Email.pm
 +++ b/Email.pm
 @@ -1,6 +1,6 @@
  package Catalyst::View::Email;

 -use warnings;
 +use warnings::register;
  use strict;

  use Class::C3;
 @@ -13,7 +13,7 @@ use base qw|Catalyst::View|;

  our $VERSION = '0.06';

 -__PACKAGE__-mk_accessors(qw(sender stash_key content_type mailer));
 +__PACKAGE__-mk_accessors(qw(sender stash_key content_type mailer
 mailer_method));

  =head1 NAME

 @@ -121,17 +121,42 @@ sub new {

  my $mailer = Email::Send-new;

 -if ( my $method = $self-sender-{method} ) {
 -croak $method is not supported, see Email::Send
 -unless $mailer-mailer_available($method);
 -$mailer-mailer($method);
 -} else {
 -# Default case, run through the most likely options first.
 -for ( qw/SMTP Sendmail Qmail/ ) {
 -$mailer-mailer($_) and last if $mailer-mailer_available($_);
 +my $chosen_method; ## get the chosen_method;
 +if ( $chosen_method ||= $self-sender-{method} ) {
 +  croak $chosen_method is not supported, see Email::Send
 +. \n\tOther installed options might include: [
 @{[$mailer-all_mailers]} ]
 +unless $mailer-mailer_available($chosen_method);
 +}
 +else {
 +
 +  foreach my $default_method ( qw/SMTP Sendmail Qmail/ ) {
 +
 +if ( $mailer-mailer_available($default_method) ) {
 +
 +  $chosen_method = $default_method;
 +
 +  warnings::warnif( 'Warning: ' . __PACKAGE__
 +.  is making assumption that $default_method is the
 desired method
 +. \n\tOther installed options might include: [
 @{[$mailer-all_mailers]} ]
 +  );
 +
 +  last;
 +
  }
 +
 +  }
 +
 +croak 'You have neither specified a valid ' . __PACKAGE__ . ' method'
 +. ' nor could one be found in our suggested list'
 +. \n\tOther installed options might include: [
 @{[$mailer-all_mailers]} ]
 +unless $chosen_method;
 +
  }

 +$mailer-mailer( $chosen_method );
 +
 +$self-mailer_method( $chosen_method );
 +
  if ( my $args = $self-sender-{mailer_args} ) {
  if ( ref $args eq 'HASH' ) {
  $mailer-mailer_args([ %$args ]);
 @@ -190,7 +215,10 @@ sub process {
  my $message = Email::MIME-create(%mime);

  if ( $message ) {
 -$self-mailer-send($message);
 +  my $resp = $self-mailer-send($message);
 +  croak SMTP is dieing caught with Email::Send::SMTP specific code 
 $resp
 +if $self-mailer_method eq 'SMTP' and !$resp
 +  ;
  } else {
  croak Unable to create message;
  }


 --
 Evan Carroll
 System Lord of the Internets
 [EMAIL PROTECTED]
 832-445-8877



-- 
Evan Carroll
System Lord of the Internets
[EMAIL PROTECTED]
832-445-8877

___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Re: [Catalyst-dev] Ignoring Emacs temp files

2007-08-30 Thread Jonathan Rockway
Matt Rosin wrote:
 Ouch. I use xemacs -nw and FindBin but haven't seen this explosion, I
 think. What autodiscovery are you using that makes it require
 Foo:::#Bar ?

Basically find | egrep 'pm$'.  I thought it would be safer to filter
on a regex like ^\w+[.]pm$ since the docs say that modules can only be
named like that, but of course, people are ignoring that in real life. 
For an example, see 日本語.pm: 
   http://www.slideshare.net/mac/perl-programming-in-japanese

Thus it's probably better to include everything and exclude the known-bad.

Regards,
Jonathan Rockway




signature.asc
Description: OpenPGP digital signature
___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Attribute::Handlers wont work in own classes under catalyst

2007-08-30 Thread Felix Antonius Wilhelm Ostmann

Nilson Santos Figueiredo Junior schrieb:

On 8/29/07, Felix Antonius Wilhelm Ostmann [EMAIL PROTECTED] wrote:
  

after a few tests we gone use this classes under catalyst ... and ...
dont work :-/ under catalyst our classes dont use Attribute::Handlers
:-/ we declare UNIVERSAL::Property and then use sub nondigit : Property
{ defined  !m{[0-9]} } (see the code)



Catalyst breaks regular subroutine attributes. Apparently, it tries to
parse them all so other code never gets the chance to parse them. I've
seen this problem before while using a module (which used subroutine
attributes) along with Catalyst and I decided to work around it
instead of looking for a proper fix.

Good luck. Hopefully someone else can come up with solution other than
using Catalyst's own attribute handling framework.
  


uh, that is hard stuff! We use this kind of attributes, cause we use the 
object also without catalyst (cronjobs etc) ... so i cant use the 
catalyst-stuff :-/


have you make a bugreport? how you is your work around?

thanks!




-Nilson Santos F. Jr.

___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/


  



--
Mit freundlichen Grüßen

Felix Antonius Wilhelm Ostmann
--
Websuche   Search   Technology   GmbH  Co. KG
Martinistraße 3  -  D-49080  Osnabrück  -  Germany
Tel.:   +49 541 40666-0 - Fax:+49 541 40666-22
Email: [EMAIL PROTECTED] - Website: www.websuche.de
--
AG Osnabrück - HRA 200252 - Ust-Ident: DE814737310
Komplementärin: Websuche   Search   Technology
Verwaltungs GmbH   -  AG Osnabrück  -   HRB 200359
Geschäftsführer:  Diplom Kaufmann Martin Steinkamp
--


___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Attribute::Handlers wont work in own classes under catalyst

2007-08-30 Thread Felix Antonius Wilhelm Ostmann
i found this bug ... Attribute::Handles has a CHECK {} block ... and 
under catalyst this block wont be executed ... but Attribute::Handlers 
need that ... what is to do?


Felix Antonius Wilhelm Ostmann schrieb:

Nilson Santos Figueiredo Junior schrieb:

On 8/29/07, Felix Antonius Wilhelm Ostmann [EMAIL PROTECTED] wrote:
 

after a few tests we gone use this classes under catalyst ... and ...
dont work :-/ under catalyst our classes dont use Attribute::Handlers
:-/ we declare UNIVERSAL::Property and then use sub nondigit : 
Property

{ defined  !m{[0-9]} } (see the code)



Catalyst breaks regular subroutine attributes. Apparently, it tries to
parse them all so other code never gets the chance to parse them. I've
seen this problem before while using a module (which used subroutine
attributes) along with Catalyst and I decided to work around it
instead of looking for a proper fix.

Good luck. Hopefully someone else can come up with solution other than
using Catalyst's own attribute handling framework.
  


uh, that is hard stuff! We use this kind of attributes, cause we use 
the object also without catalyst (cronjobs etc) ... so i cant use the 
catalyst-stuff :-/


have you make a bugreport? how you is your work around?

thanks!




-Nilson Santos F. Jr.

___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: 
http://www.mail-archive.com/catalyst@lists.rawmode.org/

Dev site: http://dev.catalyst.perl.org/


  






--
Mit freundlichen Grüßen

Felix Antonius Wilhelm Ostmann
--
Websuche   Search   Technology   GmbH  Co. KG
Martinistraße 3  -  D-49080  Osnabrück  -  Germany
Tel.:   +49 541 40666-0 - Fax:+49 541 40666-22
Email: [EMAIL PROTECTED] - Website: www.websuche.de
--
AG Osnabrück - HRA 200252 - Ust-Ident: DE814737310
Komplementärin: Websuche   Search   Technology
Verwaltungs GmbH   -  AG Osnabrück  -   HRB 200359
Geschäftsführer:  Diplom Kaufmann Martin Steinkamp
--


___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/


[Catalyst] (en) error screen translations

2007-08-30 Thread Jonathan Rockway
Should I apply these extra translations from $A_LONG_TIME_AGO?

http://grokbase.com/post/2006/04/29/catalyst-translations-for-error-message/mJp7PqYdMOElr-7JEF-m4SjP7B0

Regards,
Jonathan Rockway



signature.asc
Description: OpenPGP digital signature
___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] (en) error screen translations

2007-08-30 Thread Svilen Ivanov
Just a side note - The URL you provided screw the UTF8 for Bulgarian
translation. Here is  better one:

http://lists.scsys.co.uk/pipermail/catalyst/2006-May/007342.html

2007/8/30, Jonathan Rockway [EMAIL PROTECTED]:
 Should I apply these extra translations from $A_LONG_TIME_AGO?

 http://grokbase.com/post/2006/04/29/catalyst-translations-for-error-message/mJp7PqYdMOElr-7JEF-m4SjP7B0

 Regards,
 Jonathan Rockway


 ___
 List: Catalyst@lists.rawmode.org
 Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
 Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
 Dev site: http://dev.catalyst.perl.org/





-- 
Svilen Ivanov
http://svilen-online.blogspot.com

There is no dark side of the moon really.
Matter of fact it's all dark.

___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Attribute::Handlers wont work in own classes under catalyst

2007-08-30 Thread Felix Antonius Wilhelm Ostmann

workaround:

the skript: xyz_server.pl make a 'require xyz;' changing this to 'use 
xyz'; will couse in working code :)


just 5 hours worktime for this :-/

why there is a 'require xyz' and not 'use xyz'? what other new bugs i 
produce with my hack? :)

the xzy_fastcgi.pl have the right 'use xyz' in it ...


Felix Antonius Wilhelm Ostmann schrieb:
i found this bug ... Attribute::Handles has a CHECK {} block ... and 
under catalyst this block wont be executed ... but Attribute::Handlers 
need that ... what is to do?


Felix Antonius Wilhelm Ostmann schrieb:

Nilson Santos Figueiredo Junior schrieb:

On 8/29/07, Felix Antonius Wilhelm Ostmann [EMAIL PROTECTED] wrote:
 

after a few tests we gone use this classes under catalyst ... and ...
dont work :-/ under catalyst our classes dont use Attribute::Handlers
:-/ we declare UNIVERSAL::Property and then use sub nondigit : 
Property

{ defined  !m{[0-9]} } (see the code)



Catalyst breaks regular subroutine attributes. Apparently, it tries to
parse them all so other code never gets the chance to parse them. I've
seen this problem before while using a module (which used subroutine
attributes) along with Catalyst and I decided to work around it
instead of looking for a proper fix.

Good luck. Hopefully someone else can come up with solution other than
using Catalyst's own attribute handling framework.
  


uh, that is hard stuff! We use this kind of attributes, cause we use 
the object also without catalyst (cronjobs etc) ... so i cant use the 
catalyst-stuff :-/


have you make a bugreport? how you is your work around?

thanks!




-Nilson Santos F. Jr.

___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: 
http://www.mail-archive.com/catalyst@lists.rawmode.org/

Dev site: http://dev.catalyst.perl.org/


  









--
Mit freundlichen Grüßen

Felix Antonius Wilhelm Ostmann
--
Websuche   Search   Technology   GmbH  Co. KG
Martinistraße 3  -  D-49080  Osnabrück  -  Germany
Tel.:   +49 541 40666-0 - Fax:+49 541 40666-22
Email: [EMAIL PROTECTED] - Website: www.websuche.de
--
AG Osnabrück - HRA 200252 - Ust-Ident: DE814737310
Komplementärin: Websuche   Search   Technology
Verwaltungs GmbH   -  AG Osnabrück  -   HRB 200359
Geschäftsführer:  Diplom Kaufmann Martin Steinkamp
--


___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] (en) error screen translations

2007-08-30 Thread Jonathan Rockway
Svilen Ivanov wrote:
 Just a side note - The URL you provided screw the UTF8 for Bulgarian
 translation. Here is  better one:

 http://lists.scsys.co.uk/pipermail/catalyst/2006-May/007342.html
   
Here's the list:

(en) Please come back later
(fr) SVP veuillez revenir plus tard
(de) Bitte versuchen sie es spaeter nocheinmal
(at) Konnten's bitt'schoen spaeter nochmal reinschauen
(no) Vennligst prov igjen senere
(dk) Venligst prov igen senere
(pl) Prosze sprobowac pozniej
(pt) Por favor, volte mais tarde
(ja) 後ほどお越しください
(el) Παρακαλούμε ξαναελάτε αργότερα.
(ro) Vă rugăm să reveniţi mai târziu.
(he) אנא שובו במועד מאוחר יותר
(cn) 请稍后再来
(lb) Kommt w.e.g. spéider nach eng Kéier zeréck.
(bg) Моля, опитайте след малко
(bø) børk børk børk!


Anything else?  The thought has occurred to me that we should order
these by popularity.


signature.asc
Description: OpenPGP digital signature
___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] (en) error screen translations

2007-08-30 Thread Tatsuhiko Miyagawa
On 8/30/07, Jonathan Rockway [EMAIL PROTECTED] wrote:
 Anything else?  The thought has occurred to me that we should order
 these by popularity.

I guess you can auto-pick the most appropriate one based on
Accept-Language header. Or at least when Catalyst::Plugin::I18N is
turned on.

Just a thought.

-- 
Tatsuhiko Miyagawa

___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Attribute::Handlers wont work in own classes under catalyst

2007-08-30 Thread John Napiorkowski

--- Nilson Santos Figueiredo Junior [EMAIL PROTECTED]
wrote:

 On 8/29/07, Felix Antonius Wilhelm Ostmann
 [EMAIL PROTECTED] wrote:
  after a few tests we gone use this classes under
 catalyst ... and ...
  dont work :-/ under catalyst our classes dont use
 Attribute::Handlers
  :-/ we declare UNIVERSAL::Property and then use
 sub nondigit : Property
  { defined  !m{[0-9]} } (see the code)
 
 Catalyst breaks regular subroutine attributes.
 Apparently, it tries to
 parse them all so other code never gets the chance
 to parse them. I've
 seen this problem before while using a module (which
 used subroutine
 attributes) along with Catalyst and I decided to
 work around it
 instead of looking for a proper fix.
 
 Good luck. Hopefully someone else can come up with
 solution other than
 using Catalyst's own attribute handling framework.
 
 -Nilson Santos F. Jr.

Do we have the same problem with non action
subroutines in a Controller?  Because we have to
remember that an action declared in a controller is
being wrapped into it's own class, so we have to
expect that sub won't work quite the same way as plain
old Perl packages.  However 'normal' subs should work
fine.  I'm not so familiar with the attribute handling
module you've talked about, so I can't really be sure,
but I'd be curious if someone could try:

sub my_action :Local {
 my ($self, $c) = @_;
}

sub not_an_action :CustomAttribute {
 my $self = shift @_;
}

This trick might also work in a custom action class.

Try to think of Catalyst Components as wrappers to
other stuff and it will help.  Definitely it's great
practice to design stuff that works as a plain old
perl object and then bring it into Cat using action
classes, models, etc.




   

Choose the right car based on your needs.  Check out Yahoo! Autos new Car 
Finder tool.
http://autos.yahoo.com/carfinder/

___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/


[Catalyst] weird problem with session_expires

2007-08-30 Thread Nicolas Raspail

Hello,

I have a strange problem with my session. I'm using Session,  
Session::State::URI and Session::Store::FastMmap and XML RPC commands.


I can successfully use session, but when I want to check if a session  
has expired or not, session_expires never returns me 0 if the session  
has expired. Instead, it seems that it returns me the expire time plus  
the time between the two XML RPC call !


Example:

my test script sends a first command, sleep 10 seconds and sends the  
second command. Here is the debug output I get :


[info] *** Request 1 (0.167/s) [590] [Thu Aug 30 16:08:39 2007] ***
[debug] POST request for rpc from 10.30.72.167
[debug] XML-RPC: Method called: login
[debug] Path is login
[debug] Created session 46616ce55819d55f5af3b062061e86fa0abc5a99
[fatal] $VAR1 = {
  '__user_realm' = 'default',
  'data' = 'Session 46616ce55819d55f5af3b062061e86fa0abc5a99',
  '__user' = bless( {
   'password' = 'test',
   'store' =  
'Catalyst::Plugin::Authentication::Store::Minimal',

   'auth_realm' = 'default',
   'id' = 'nicolas',
   '__hash_obj_key_is_array' = {}
 },  
'Catalyst::Plugin::Authentication::User::Hash' ),

  '__created' = 1188482919,
  '__updated' = 1188482919
};
[info] Request took 0.034786s (28.747/s)
.+---.
| Action | Time  |
++---+
| /xmlrpc/login  | 0.006627s |
| /xmlrpc/end| 0.50s |
'+---'

[info] *** Request 2 (0.118/s) [590] [Thu Aug 30 16:08:50 2007] ***
[debug] Query Parameters are:
.-+--.
| Parameter   | Value|
+-+--+
| sessionid   | 46616ce55819d55f5af3b062061e86fa0ab- |
| | c5a99|
'-+--'
[debug] POST request for rpc/ from 10.30.72.167
[debug] XML-RPC: Method called: host_register
[debug] Found sessionid 46616ce55819d55f5af3b062061e86fa0abc5a99 in  
query parameters

[debug] Path is host_register
[fatal] 1188482979 (from $c-get_session_data)
[fatal] Expire 1188482990 (from $c-session_expires)
[debug] Restored session 46616ce55819d55f5af3b062061e86fa0abc5a99
[fatal] Session 46616ce55819d55f5af3b062061e86fa0abc5a99
[fatal] hostid = 1e0aa748
[fatal] hostname = rhel5-test
[info] Request took 0.019859s (50.355/s)
.+---.
| Action | Time  |
++---+
| /xmlrpc/host_register  | 0.002980s |
| /xmlrpc/end| 0.46s |
'+---'

As you can see, there is a difference between the time in the store  
area and the time returned from session_expires.


Am'I doing a mistake or there is a sort of bug ?

Regards

Nicolas


___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/


[Catalyst] Re: (en) error screen translations

2007-08-30 Thread Adam Sjøgren
On Thu, 30 Aug 2007 06:40:03 -0500, Jonathan wrote:

 (dk) Venligst prov igen senere

Should probably be:

 (dk) Prøv venligst igen senere

Notice the oslash.

(I think the Norwegian line also has an 'o' that should be something
else, but I will leave that to the Norwegians.)

 Anything else? The thought has occurred to me that we should order
 these by popularity.

Or by accumulated olympic gold medals in handball for women.


  Best regards,

Adam

-- 
 I love loopholes.  Adam Sjøgren
 [EMAIL PROTECTED]

___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] weird problem with session_expires

2007-08-30 Thread Nicolas Raspail

Felix Antonius Wilhelm Ostmann a écrit :


Nicolas Raspail schrieb:

Hello,

I have a strange problem with my session. I'm using Session, 
Session::State::URI and Session::Store::FastMmap and XML RPC commands.


I can successfully use session, but when I want to check if a session 
has expired or not, session_expires never returns me 0 if the session 
has expired. Instead, it seems that it returns me the expire time plus 
the time between the two XML RPC call !


Example:

my test script sends a first command, sleep 10 seconds and sends the 
second command. Here is the debug output I get :


[info] *** Request 1 (0.167/s) [590] [Thu Aug 30 16:08:39 2007] ***
[debug] POST request for rpc from 10.30.72.167
[debug] XML-RPC: Method called: login
[debug] Path is login
[debug] Created session 46616ce55819d55f5af3b062061e86fa0abc5a99
[fatal] $VAR1 = {
  '__user_realm' = 'default',
  'data' = 'Session 46616ce55819d55f5af3b062061e86fa0abc5a99',
  '__user' = bless( {
   'password' = 'test',
   'store' = 
'Catalyst::Plugin::Authentication::Store::Minimal',

   'auth_realm' = 'default',
   'id' = 'nicolas',
   '__hash_obj_key_is_array' = {}
 }, 
'Catalyst::Plugin::Authentication::User::Hash' ),

  '__created' = 1188482919,
  '__updated' = 1188482919
};
[info] Request took 0.034786s (28.747/s)
.+---. 

| Action | 
Time  |
++---+ 

| /xmlrpc/login  | 
0.006627s |
| /xmlrpc/end| 
0.50s |
'+---' 



[info] *** Request 2 (0.118/s) [590] [Thu Aug 30 16:08:50 2007] ***
[debug] Query Parameters are:
.-+--. 

| Parameter   | 
Value|
+-+--+ 

| sessionid   | 
46616ce55819d55f5af3b062061e86fa0ab- |
| | 
c5a99|
'-+--' 


[debug] POST request for rpc/ from 10.30.72.167
[debug] XML-RPC: Method called: host_register
[debug] Found sessionid 46616ce55819d55f5af3b062061e86fa0abc5a99 in 
query parameters

[debug] Path is host_register
[fatal] 1188482979 (from $c-get_session_data)
[fatal] Expire 1188482990 (from $c-session_expires)
[debug] Restored session 46616ce55819d55f5af3b062061e86fa0abc5a99
[fatal] Session 46616ce55819d55f5af3b062061e86fa0abc5a99
[fatal] hostid = 1e0aa748
[fatal] hostname = rhel5-test
[info] Request took 0.019859s (50.355/s)
.+---. 

| Action | 
Time  |
++---+ 

| /xmlrpc/host_register  | 
0.002980s |
| /xmlrpc/end| 
0.46s |
'+---' 



As you can see, there is a difference between the time in the store 
area and the time returned from session_expires.


Am'I doing a mistake or there is a sort of bug ?

Regards

Nicolas



 Hmmm ... i think a session would never expire when you do every 10
 seconds a request ... because he update the session every time. when the
 time between two requests is greater then session_expire, then the
 session will be deleted.

 MfG
 Felix Ostmann


Hi,

in fact, I have forgotten to copy/paste the second example, with a delay 
of 90 seconds between the two request. In this example, we can see the 
same behaviour, with some debug info about the fact that Catalyst knows 
about the fact that the session has expired, but the session_expires 
function does not return zero, but the current time !


Regards

Nicolas

___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] (en) error screen translations

2007-08-30 Thread Ronald J Kimball

Jonathan Rockway wrote:

Here's the list:

(en) Please come back later
(fr) SVP veuillez revenir plus tard
(de) Bitte versuchen sie es spaeter nocheinmal
(at) Konnten's bitt'schoen spaeter nochmal reinschauen
(no) Vennligst prov igjen senere
(dk) Venligst prov igen senere
(pl) Prosze sprobowac pozniej
(pt) Por favor, volte mais tarde
(ja) 後ほどお越しください
(el) Παρακαλούμε ξαναελάτε αργότερα.
(ro) Vă rugăm să reveniţi mai târziu.
(he) אנא שובו במועד מאוחר יותר
(cn) 请稍后再来
(lb) Kommt w.e.g. spéider nach eng Kéier zeréck.
(bg) Моля, опитайте след малко
(bø) børk børk børk!


Anything else?  The thought has occurred to me that we should order
these by popularity.


Needs a Spanish translation.

Ronald

___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] (en) error screen translations

2007-08-30 Thread Emanuele Zeppieri

Jonathan Rockway wrote:


Here's the list:

(en) Please come back later
(fr) SVP veuillez revenir plus tard
(de) Bitte versuchen sie es spaeter nocheinmal
(at) Konnten's bitt'schoen spaeter nochmal reinschauen
(no) Vennligst prov igjen senere
(dk) Venligst prov igen senere
(pl) Prosze sprobowac pozniej
(pt) Por favor, volte mais tarde
(ja) 後ほどお越しください
(el) Παρακαλούμε ξαναελάτε αργότερα.
(ro) Vă rugăm să reveniţi mai târziu.
(he) אנא שובו במועד מאוחר יותר
(cn) 请稍后再来
(lb) Kommt w.e.g. spéider nach eng Kéier zeréck.
(bg) Моля, опитайте след малко
(bø) børk børk børk!


Anything else?  The thought has occurred to me that we should order
these by popularity.


(it) Si prega di riprovare più tardi.
___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] (en) error screen translations

2007-08-30 Thread Fernan Aguero

| Jonathan Rockway wrote:
 Here's the list:
 (en) Please come back later
 (fr) SVP veuillez revenir plus tard
 (de) Bitte versuchen sie es spaeter nocheinmal
 (at) Konnten's bitt'schoen spaeter nochmal reinschauen
 (no) Vennligst prov igjen senere
 (dk) Venligst prov igen senere
 (pl) Prosze sprobowac pozniej
 (pt) Por favor, volte mais tarde
 (ja) ??
 (el) ?? ?? .
 (ro) V?? rug??m s?? reveni??i mai târziu.
 (he) ??  ?? ?? 
 (cn) ???
 (lb) Kommt w.e.g. spéider nach eng Kéier zeréck.
 (bg) ,   ??
 (bø) børk børk børk!
 Anything else?  The thought has occurred to me that we should order
 these by popularity.
| 
| Needs a Spanish translation.
| 

(es) Por favor, vuelva más tarde.

___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/


[Catalyst] FastCGI config for standalone mode

2007-08-30 Thread Will Hawes
I've set up a Catalyst app with Apache2 and FastCGI using the config
described under Standalone server mode at
http://search.cpan.org/~jrockway/Catalyst-Manual-5.701002/lib/Catalyst/Manual/Cookbook.pod#Standalone_server_mode.
Everything works fine when the FastCGI server is running via the helper
script and I can use the app without problems.

The docs state that when the backend FastCGI server is down, Apache will
return a 502 error. The suggestion is to use an ErrorDocument directive to
display a down for maintenance page when this is the case. However, Apache
is actually returning a 500 error, not a 502. Apache's error log contains
only the following:

[Thu Aug 30 23:26:19 2007] [error] [client 127.0.0.1] (111)Connection
refused: FastCGI: failed to connect to server /tmp/myapp.fcgi: connect()
failed
[Thu Aug 30 23:26:19 2007] [error] [client 127.0.0.1] FastCGI: incomplete
headers (0 bytes) received from server /tmp/myapp.fcgi

I have copied everything verbatim from the docs so assuming they are
correct, I'd have expected this to work. I must have missed something.

Does anyone have this setup working successfully? Why would I be getting a
500 error as opposed to a 502 here?
___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/


[Catalyst] unbuffered output via multiple templates

2007-08-30 Thread Todd Harris
Hi all -

Quick introduction:  I'm new to Catalys, but I've been reading the
mailing list online for some time.  I finally have a suitable project
and have just started working on it.  The documentation on list so far
have been a great help.

My question:  I'd like to unbuffer output a la $|++.  I thought one
approach might be to have a series of templates per page, rendering
each sequentially, delivering each to the client in turn.

So far I've come across two possible solutions: 1. SubRequest and 2.
View::TT-render.

But it seems that trapping the output of either and writing to STDOUT
closes the request, such that only the first template is rendered and
sent to the browser.

Some pseudo code to illustrate:

sub myaction : Local {
  my $something = $c-subreq('/do_something',{ bar = $c-stash-{bar} });
  $c-res-body($text);
  $c-res-write($text);

  my $else = $c-subreq('/do_something_else',{ foo = $c-stash-{foo} });
  $c-res-body($else);
  $c-res-write($else);
}

sub do_something : Local {
   my ($self,$c) = @_;
   $c-stash-{load_em_up} = 'here we go';
}

Am I completely off track here?  I've used a monolithic template with
lots of includes but that is not exactly what I would like to
accomplish here.

Thanks in advance for suggestions.

Henri

___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] (en) error screen translations

2007-08-30 Thread Toby Corkindale
Jonathan Rockway wrote:
 Here's the list:
 
 (en) Please come back later
 (fr) SVP veuillez revenir plus tard
 (de) Bitte versuchen sie es spaeter nocheinmal
 (at) Konnten's bitt'schoen spaeter nochmal reinschauen
 (no) Vennligst prov igjen senere
 (dk) Venligst prov igen senere
 (pl) Prosze sprobowac pozniej
 (pt) Por favor, volte mais tarde
 (ja) 後ほどお越しください
 (el) Παρακαλούμε ξαναελάτε αργότερα.
 (ro) Vă rugăm să reveniţi mai târziu.
 (he) אנא שובו במועד מאוחר יותר
 (cn) 请稍后再来
 (lb) Kommt w.e.g. spéider nach eng Kéier zeréck.
 (bg) Моля, опитайте след малко
 (bø) børk børk børk!
 
 
 Anything else?  The thought has occurred to me that we should order
 these by popularity.

Quenya and Sindarin?

I'll see if I can get them.

Toby

___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/