diff options
| author | fukachan <fukachan> | 2005-06-04 08:55:57 +0000 |
|---|---|---|
| committer | fukachan <fukachan> | 2005-06-04 08:55:57 +0000 |
| commit | 8717a2b3dc1591793d9f2e883f31f0095e100fc3 (patch) | |
| tree | 30771b29b53fd74b4e6237da4fc54edc682cab27 /fml | |
| parent | 96a487c3b233295d6f11716d9369e6ef6eca1809 (diff) | |
| download | fml8-8717a2b3dc1591793d9f2e883f31f0095e100fc3.tar.gz fml8-8717a2b3dc1591793d9f2e883f31f0095e100fc3.tar.bz2 fml8-8717a2b3dc1591793d9f2e883f31f0095e100fc3.zip | |
switched to use FML::Process::Switch::NewProcess().
bug fix pcb handling.
method naming fixed to $curproc->OBJ_METHOD() form (FNF).
get_article_id -> article_get_id
set_article_id -> article_set_id
config_files_append_to_list -> config_files_append
append_to_config_files_list -> config_files_append_to_list
get_config_files_list -> config_files_get_list
load_config_files -> config_files_load
set_config_files_list -> config_files_set_list
verify_sender_credential -> credential_verify_sender
get_current_process_ml_name -> current_process_get_ml_name
set_current_process_ml_name -> current_process_set_ml_name
fix_perl_include_path -> env_fix_perl_include_path
parse_exception -> exception_parse
parse_incoming_message -> incoming_message_parse
clean_up_incoming_queue -> incoming_message_queue_clean_up
get_cui_menu -> menu_get_cui_config_file_path
get_gui_menu -> menu_get_gui_config_file_path
resolve_ml_specific_variables -> ml_variables_resolve
outgoing_message_open_channel -> outgoing_message_cache_open
open_outgoing_message_channel -> outgoing_message_open_channel
inform_reply_messages -> reply_message_inform
prepare_file_to_return -> reply_message_prepare_template
clean_up_tmpfiles -> tmp_files_clean_up
reset_umask -> umask_reset
set_umask_as_public -> umask_set_as_public
Diffstat (limited to 'fml')
| -rw-r--r-- | fml/lib/FML/Process/Fake.pm | 58 |
1 files changed, 22 insertions, 36 deletions
diff --git a/fml/lib/FML/Process/Fake.pm b/fml/lib/FML/Process/Fake.pm index 5b0bb997..2c554b4e 100644 --- a/fml/lib/FML/Process/Fake.pm +++ b/fml/lib/FML/Process/Fake.pm @@ -3,7 +3,7 @@ # Copyright (C) 2003,2004,2005 Ken'ichi Fukamachi # All rights reserved. # -# $FML: Fake.pm,v 1.11 2005/05/27 01:02:56 fukachan Exp $ +# $FML: Fake.pm,v 1.12 2005/05/30 07:20:23 fukachan Exp $ # package FML::Process::Fake; @@ -221,8 +221,8 @@ sub _faker_init $config->set('ml_home_dir', $ml_home_dir); # init - $curproc->load_config_files(); - $curproc->fix_perl_include_path(); + $curproc->config_files_load(); + $curproc->env_fix_perl_include_path(); $curproc->scheduler_init(); $curproc->log_message_init(); @@ -249,7 +249,7 @@ sub _faker_prepare my ($curproc) = @_; # 1. parse message - $curproc->parse_incoming_message(); + $curproc->incoming_message_parse(); } @@ -387,40 +387,26 @@ sub _faker_process_switch my ($curproc, $args, $ml_name, $ml_domain) = @_; my $ml_addr = sprintf("%s@%s", $ml_name, $ml_domain); - print STDERR "Start ml emulation: $ml_name\@$ml_domain\n"; - - # debug - $ml_addr = 'elena@home.fml.org'; - print STDERR "Start ml emulation: $ml_addr\n"; - - # modify $args - my $myname = "distribute"; - $args->{ myname } = $myname; - $args->{ program_name } = $myname; - $args->{ program_fullname } =~ s/faker/$myname/; - $args->{ argv } = [ $ml_addr ]; - $args->{ ARGV } = [ $ml_addr ]; + $curproc->logdebug("start ml emulation: $ml_name\@$ml_domain"); # start the process. - eval q{ - local(@ARGV) = ( $ml_addr ); - - my $path = $curproc->get_incoming_message_cache_file_path(); - if ($path) { - open(STDIN, $path); - } - else { - $curproc->log("path = <$path>"); - croak("fail to open STDIN"); + my $path = $curproc->incoming_message_get_cache_file_path(); + if ($path) { + unless (open(STDIN, $path)) { + $curproc->logerror("cannot open $path"); } + } + else { + $curproc->logerror("cache file not found"); + } - use FML::Process::Switch; - my $obj = FML::Process::Switch::load_module($myname, $args); - - use FML::Process::Flow; - &FML::Process::Flow::ProcessStart($obj, $args); - }; - $curproc->logerror($@) if $@; + my $myname = "distribute"; + use FML::Process::Switch; + &FML::Process::Switch::NewProcess($curproc, + $args, + $myname, + $ml_name, + $ml_domain); } @@ -523,7 +509,7 @@ sub set_emul_ml_list { my ($curproc, $list) = @_; my $pcb = $curproc->pcb(); - $pcb->get("faker", "ml_user_part_list", $list); + $pcb->set("faker", "ml_user_part_list", $list); } @@ -558,7 +544,7 @@ sub set_emul_user_list { my ($curproc, $list) = @_; my $pcb = $curproc->pcb(); - $pcb->get("faker", "user_list", $list); + $pcb->set("faker", "user_list", $list); } |
