r45264 - in /branches/upstream/libpoe-loop-event-perl: ./ current/ current/lib/ current/lib/POE/ current/lib/POE/Loop/ current/t/

jawnsy-guest at users.alioth.debian.org jawnsy-guest at users.alioth.debian.org
Sat Oct 3 16:01:50 UTC 2009


Author: jawnsy-guest
Date: Sat Oct  3 16:01:36 2009
New Revision: 45264

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=45264
Log:
[svn-inject] Installing original source of libpoe-loop-event-perl

Added:
    branches/upstream/libpoe-loop-event-perl/
    branches/upstream/libpoe-loop-event-perl/current/
    branches/upstream/libpoe-loop-event-perl/current/CHANGES
    branches/upstream/libpoe-loop-event-perl/current/MANIFEST
    branches/upstream/libpoe-loop-event-perl/current/MANIFEST.SKIP
    branches/upstream/libpoe-loop-event-perl/current/META.yml
    branches/upstream/libpoe-loop-event-perl/current/Makefile.PL
    branches/upstream/libpoe-loop-event-perl/current/README
    branches/upstream/libpoe-loop-event-perl/current/lib/
    branches/upstream/libpoe-loop-event-perl/current/lib/POE/
    branches/upstream/libpoe-loop-event-perl/current/lib/POE/Loop/
    branches/upstream/libpoe-loop-event-perl/current/lib/POE/Loop/Event.pm
    branches/upstream/libpoe-loop-event-perl/current/t/
    branches/upstream/libpoe-loop-event-perl/current/t/00_info.t

Added: branches/upstream/libpoe-loop-event-perl/current/CHANGES
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libpoe-loop-event-perl/current/CHANGES?rev=45264&op=file
==============================================================================
--- branches/upstream/libpoe-loop-event-perl/current/CHANGES (added)
+++ branches/upstream/libpoe-loop-event-perl/current/CHANGES Sat Oct  3 16:01:36 2009
@@ -1,0 +1,53 @@
+=====================================
+2009-08-27T04:27:04.178834Z ple-1_302
+=====================================
+
+  2009-08-27 04:25:09 (r2650) by rcaputo
+  polo-event/Makefile.PL M; polo-event/lib/POE/Loop/Event.pm M
+
+    Add the info test we forgot to include.
+
+=====================================
+2009-08-26T15:36:10.468146Z ple-1_301
+=====================================
+
+  2009-08-26 15:31:23 (r2644) by rcaputo
+  polo-event/Makefile.PL M; polo-event/lib/POE/Loop/Event.pm M
+
+    Add POE::Test::Loops to configure_requires and build_requires.
+
+  2009-08-26 02:30:10 (r2637) by rcaputo; polo-event/Makefile.PL M
+
+    We use the generic svn-log.perl, not the one included in POE.
+
+=====================================
+2009-08-26T02:22:29.916075Z ple-1_300
+=====================================
+
+  2009-08-25 17:05:17 (r2635) by rcaputo
+  polo-gtk/lib/POE/Loop A; polo-gtk/lib/POE/Loop/Gtk.pm A;
+  polo-tk/MANIFEST.SKIP A; polo-gtk/lib A; polo-gtk/MANIFEST A;
+  polo-gtk/MANIFEST.SKIP A; poe/lib/POE/Loop/TkActiveState.pm D;
+  polo-tk/Makefile.PL A; polo-tk/lib/POE A; polo-tk/lib/POE/Loop/Tk.pm A;
+  polo-gtk/Makefile.PL A; polo-tk/t/00_info.t A; polo-tk A;
+  poe/lib/POE/Loop/Gtk.pm D; polo-gtk/lib/POE A;
+  poe/lib/POE/Loop/TkCommon.pm D; polo-tk/lib/POE/Loop A; polo-tk/t A;
+  polo-gtk/README A; polo-event/lib/POE/Loop A; polo-gtk/t/00_info.t A;
+  polo-tk/MANIFEST A; polo-gtk A; polo-event/MANIFEST A; polo-event/lib
+  A; polo-gtk/t A; polo-event/MANIFEST.SKIP A;
+  polo-tk/lib/POE/Loop/TkActiveState.pm A; poe/mylib/Makefile-5005.pm M;
+  poe/lib/POE/Loop/Tk.pm D; polo-event/Makefile.PL A;
+  poe/lib/POE/Loop/Event.pm D; polo-event/lib/POE A; polo-tk/README A;
+  polo-event/README A; polo-event/lib/POE/Loop/Event.pm A;
+  polo-event/t/00_info.t A; polo-event A;
+  polo-tk/lib/POE/Loop/TkCommon.pm A; poe/MANIFEST M; polo-tk/lib A;
+  polo-event/t A
+
+    Create new project directories for POE::Loop::{Event,Tk,Gtk}. Moved
+    the loops to their new project directories. Configured the new
+    projects for CPAN distribution. Removed the event loops from POE's
+    distro configuration. 
+
+==============
+End of Excerpt
+==============

Added: branches/upstream/libpoe-loop-event-perl/current/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libpoe-loop-event-perl/current/MANIFEST?rev=45264&op=file
==============================================================================
--- branches/upstream/libpoe-loop-event-perl/current/MANIFEST (added)
+++ branches/upstream/libpoe-loop-event-perl/current/MANIFEST Sat Oct  3 16:01:36 2009
@@ -1,0 +1,8 @@
+CHANGES
+MANIFEST
+MANIFEST.SKIP
+META.yml
+Makefile.PL
+README
+lib/POE/Loop/Event.pm
+t/00_info.t

Added: branches/upstream/libpoe-loop-event-perl/current/MANIFEST.SKIP
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libpoe-loop-event-perl/current/MANIFEST.SKIP?rev=45264&op=file
==============================================================================
--- branches/upstream/libpoe-loop-event-perl/current/MANIFEST.SKIP (added)
+++ branches/upstream/libpoe-loop-event-perl/current/MANIFEST.SKIP Sat Oct  3 16:01:36 2009
@@ -1,0 +1,29 @@
+CVS
+\.\#
+\.bak$
+\.cvsignore
+\.gz$
+\.orig$
+\.patch$
+\.ppd$
+\.rej$
+\.rej$
+\.svn
+\.swo$
+\.swp$
+^Makefile$
+^Makefile\.old$
+^\.
+^_Inline
+^_build
+^blib/
+^comptest
+^cover_db
+^coverage\.report$
+^docs
+^pm_to_blib$
+^poe_report\.xml$
+run_network_tests
+test-output\.err$
+t/[23]0_.*\.t
+~$

Added: branches/upstream/libpoe-loop-event-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libpoe-loop-event-perl/current/META.yml?rev=45264&op=file
==============================================================================
--- branches/upstream/libpoe-loop-event-perl/current/META.yml (added)
+++ branches/upstream/libpoe-loop-event-perl/current/META.yml Sat Oct  3 16:01:36 2009
@@ -1,0 +1,28 @@
+--- #YAML:1.0
+name:               POE-Loop-Event
+version:            1.302
+abstract:           Event.pm support for POE.
+author:
+    - Rocco Caputo <rcaputo at cpan.org>
+license:            unknown
+distribution_type:  module
+configure_requires:
+    ExtUtils::MakeMaker:  0
+    POE::Test::Loops:     1.021
+build_requires:
+    ExtUtils::MakeMaker:  0
+    POE::Test::Loops:     1.021
+requires:
+    Event:  1.11
+    POE:    1.007
+resources:
+    license:     http://dev.perl.org/licenses/
+    repository:  https://poe.svn.sourceforge.net/svnroot/poe/trunk/polo-event
+no_index:
+    directory:
+        - t
+        - inc
+generated_by:       ExtUtils::MakeMaker version 6.54
+meta-spec:
+    url:      http://module-build.sourceforge.net/META-spec-v1.4.html
+    version:  1.4

Added: branches/upstream/libpoe-loop-event-perl/current/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libpoe-loop-event-perl/current/Makefile.PL?rev=45264&op=file
==============================================================================
--- branches/upstream/libpoe-loop-event-perl/current/Makefile.PL (added)
+++ branches/upstream/libpoe-loop-event-perl/current/Makefile.PL Sat Oct  3 16:01:36 2009
@@ -1,0 +1,108 @@
+#!/usr/bin/perl
+# rocco // vim: ts=2 sw=2 expandtab
+
+use warnings;
+use strict;
+use ExtUtils::MakeMaker;
+use POE::Test::Loops;
+
+# Switch to default behavior if STDIN isn't a tty.
+
+unless (-t STDIN) {
+  warn(
+    "\n",
+    "=============================================\n\n",
+    "STDIN is not a terminal.  Assuming --default.\n\n",
+    "=============================================\n\n",
+  );
+  push @ARGV, "--default";
+}
+
+# Remind the user she can use --default.
+
+unless (grep /^--default$/, @ARGV) {
+  warn(
+    "\n",
+    "=============================================\n\n",
+    "Prompts may be bypassed by running:\n",
+    "   $^X $0 --default\n\n",
+    "=============================================\n\n",
+  );
+}
+
+# Should we skip the network tests?
+
+my $prompt = (
+  "Some of POE::Loop::Event's tests require a\n" .
+  "functional network.  You can skip these network\n" .
+  "tests if you'd like.\n\n" .
+  "Would you like to skip the network tests?"
+);
+
+my $ret = "n";
+if (grep /^--default$/, @ARGV) {
+  print $prompt, " [$ret] $ret\n\n";
+}
+else {
+  $ret = prompt($prompt, "n");
+}
+
+my $marker = 'run_network_tests';
+unlink $marker;
+unless ($ret =~ /^Y$/i) {
+  open(TOUCH,"+>$marker") and close TOUCH;
+}
+
+print "\n";
+
+### Touch files that will be generated at "make dist" time.
+### ExtUtils::MakeMaker and Module::Build will complain about them if
+### they aren't present now.
+
+open(TOUCH, ">>CHANGES")  and close TOUCH;
+open(TOUCH, ">>META.yml") and close TOUCH;
+
+POE::Test::Loops::generate( 't', [ 'POE::Loop::Event' ], 0 );
+
+WriteMakefile(
+  NAME            => 'POE::Loop::Event',
+  AUTHOR          => 'Rocco Caputo <rcaputo at cpan.org>',
+  ABSTRACT        => 'Event.pm support for POE.',
+  VERSION_FROM    => 'lib/POE/Loop/Event.pm',
+  META_ADD        => {
+    resources     => {
+      license     => 'http://dev.perl.org/licenses/',
+      repository  => (
+        'https://poe.svn.sourceforge.net/svnroot/poe/trunk/polo-event'
+      ),
+    },
+  },
+  dist            => {
+    COMPRESS      => 'gzip -9f',
+    SUFFIX        => 'gz',
+    PREOP         => (
+      'svn-log.perl --tags ^ple- | ' .
+      '/usr/bin/tee ./$(DISTNAME)-$(VERSION)/CHANGES > ./CHANGES'
+    ),
+  },
+  clean           => { FILES => 't/poe_loop_event/*.t t/poe_loop_event' },
+  test            => { TESTS => 't/*.t t/poe_loop_event/*.t' },
+
+  CONFIGURE_REQUIRES => {
+    'ExtUtils::MakeMaker' => 0,
+    'POE::Test::Loops'    => 1.021,
+  },
+
+  META_MERGE      => {
+    build_requires => {
+      'POE::Test::Loops'    => 1.021,
+    },
+  },
+
+  PREREQ_PM       => {
+    'POE'               => 1.007,
+    'Event'             => 1.11,
+  },
+);
+
+1;

Added: branches/upstream/libpoe-loop-event-perl/current/README
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libpoe-loop-event-perl/current/README?rev=45264&op=file
==============================================================================
--- branches/upstream/libpoe-loop-event-perl/current/README (added)
+++ branches/upstream/libpoe-loop-event-perl/current/README Sat Oct  3 16:01:36 2009
@@ -1,0 +1,12 @@
+POE supports nearly any event loop imaginable through POE::Loop plugin
+modules.  POE::Loop::Event is the plugin support for Joshua Pritikin's
+Event module.
+
+See http://search.cpan.org/search?query=POE%3A%3ALoop&mode=module for
+a list of other event loops POE supports.
+
+POE::Loop documents the generic API for all POE::Loop subclasses.  You
+are invited to implement this API for your favorite event loop.
+Kudos, bug reports, and patches are also welcome.
+
+Thank you!

Added: branches/upstream/libpoe-loop-event-perl/current/lib/POE/Loop/Event.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libpoe-loop-event-perl/current/lib/POE/Loop/Event.pm?rev=45264&op=file
==============================================================================
--- branches/upstream/libpoe-loop-event-perl/current/lib/POE/Loop/Event.pm (added)
+++ branches/upstream/libpoe-loop-event-perl/current/lib/POE/Loop/Event.pm Sat Oct  3 16:01:36 2009
@@ -1,0 +1,247 @@
+# Event.pm event loop bridge for POE::Kernel.
+
+# Empty package to appease perl.
+package POE::Loop::Event;
+
+use strict;
+
+# Include common signal handling.  Signals should be safe now, and for
+# some reason Event isn't dispatching SIGCHLD to me circa POE r2084.
+use POE::Loop::PerlSignals;
+
+use vars qw($VERSION);
+$VERSION = '1.302'; # NOTE - Should be #.### (three decimal places)
+
+=for poe_tests
+
+sub skip_tests {
+  return "Event tests require the Event module" if (
+    do { eval "use Event"; $@ }
+  );
+  my $test_name = shift;
+  if ($test_name eq "k_signals_rerun" and $^O eq "MSWin32") {
+    return "This test crashes Perl when run with Tk on $^O";
+  }
+  if ($test_name eq "wheel_readline" and $^O eq "darwin") {
+    return "Event skips two of its own tests for the same reason";
+  }
+}
+
+=cut
+
+# Everything plugs into POE::Kernel.
+package POE::Kernel;
+
+use strict;
+
+my $_watcher_timer;
+my @fileno_watcher;
+my %signal_watcher;
+
+#------------------------------------------------------------------------------
+# Loop construction and destruction.
+
+sub loop_initialize {
+  my $self = shift;
+
+  $_watcher_timer = Event->timer(
+    cb     => \&_loop_event_callback,
+    desc   => 'dispatch_timer',
+    after  => 0,
+  );
+}
+
+sub loop_finalize {
+  my $self = shift;
+
+  foreach my $fd (0..$#fileno_watcher) {
+    next unless defined $fileno_watcher[$fd];
+    foreach my $mode (MODE_RD, MODE_WR, MODE_EX) {
+      POE::Kernel::_warn(
+        "Mode $mode watcher for fileno $fd is defined during loop finalize"
+      ) if defined $fileno_watcher[$fd]->[$mode];
+    }
+  }
+
+  $self->loop_ignore_all_signals();
+}
+
+#------------------------------------------------------------------------------
+# Signal handler maintenance functions.
+
+sub loop_attach_uidestroy {
+  # does nothing
+}
+
+#------------------------------------------------------------------------------
+# Maintain time watchers.
+
+sub loop_resume_time_watcher {
+  my ($self, $next_time) = @_;
+  ($_watcher_timer and $next_time) or return;
+  $_watcher_timer->at($next_time);
+  $_watcher_timer->start();
+}
+
+sub loop_reset_time_watcher {
+  my ($self, $next_time) = @_;
+  $_watcher_timer or return;
+  $self->loop_pause_time_watcher();
+  $self->loop_resume_time_watcher($next_time);
+}
+
+sub loop_pause_time_watcher {
+  $_watcher_timer or return;
+  $_watcher_timer->stop();
+}
+
+#------------------------------------------------------------------------------
+# Maintain filehandle watchers.
+
+sub loop_watch_filehandle {
+  my ($self, $handle, $mode) = @_;
+  my $fileno = fileno($handle);
+
+  # Overwriting a pre-existing watcher?
+  if (defined $fileno_watcher[$fileno]->[$mode]) {
+    $fileno_watcher[$fileno]->[$mode]->cancel();
+    undef $fileno_watcher[$fileno]->[$mode];
+  }
+
+  $fileno_watcher[$fileno]->[$mode] = Event->io(
+    fd => $fileno,
+    desc => "io_watcher $handle $fileno $mode",
+    poll => (
+      ( $mode == MODE_RD )
+      ? 'r'
+      : (
+        ( $mode == MODE_WR )
+        ? 'w'
+        : 'e'
+      )
+    ),
+    cb => \&_loop_select_callback,
+  );
+}
+
+sub loop_ignore_filehandle {
+  my ($self, $handle, $mode) = @_;
+  my $fileno = fileno($handle);
+
+  # Don't bother removing a select if none was registered.
+  if (defined $fileno_watcher[$fileno]->[$mode]) {
+    $fileno_watcher[$fileno]->[$mode]->cancel();
+    undef $fileno_watcher[$fileno]->[$mode];
+  }
+}
+
+sub loop_pause_filehandle {
+  my ($self, $handle, $mode) = @_;
+  my $fileno = fileno($handle);
+  $fileno_watcher[$fileno]->[$mode]->stop();
+}
+
+sub loop_resume_filehandle {
+  my ($self, $handle, $mode) = @_;
+  my $fileno = fileno($handle);
+  $fileno_watcher[$fileno]->[$mode]->start();
+}
+
+# Timer callback to dispatch events.
+
+my $last_time = time();
+
+sub _loop_event_callback {
+  my $self = $poe_kernel;
+
+  if (TRACE_STATISTICS) {
+    # TODO - I'm pretty sure the startup time will count as an unfair
+    # amount of idleness.
+    #
+    # TODO - Introducing many new time() syscalls.  Bleah.
+    $self->_data_stat_add('idle_seconds', time() - $last_time);
+  }
+
+  $self->_data_ev_dispatch_due();
+  $self->_test_if_kernel_is_idle();
+
+  # Transferring control back to Event; this is idle time.
+  $last_time = time() if TRACE_STATISTICS;
+}
+
+# Event filehandle callback to dispatch selects.
+sub _loop_select_callback {
+  my $self = $poe_kernel;
+
+  my $event = shift;
+  my $watcher = $event->w;
+  my $fileno = $watcher->fd;
+  my $mode = (
+    ( $event->got eq 'r' )
+    ? MODE_RD
+    : (
+      ( $event->got eq 'w' )
+      ? MODE_WR
+      : (
+        ( $event->got eq 'e' )
+        ? MODE_EX
+        : return
+      )
+    )
+  );
+
+  $self->_data_handle_enqueue_ready($mode, $fileno);
+  $self->_test_if_kernel_is_idle();
+}
+
+#------------------------------------------------------------------------------
+# The event loop itself.
+
+sub loop_do_timeslice {
+  Event::one_event();
+}
+
+sub loop_run {
+  my $self = shift;
+  while ($self->_data_ses_count()) {
+    $self->loop_do_timeslice();
+  }
+}
+
+sub loop_halt {
+  $_watcher_timer->stop();
+  $_watcher_timer = undef;
+  Event::unloop_all(0);
+}
+
+1;
+
+__END__
+
+=head1 NAME
+
+POE::Loop::Event - a bridge that allows POE to be driven by Event.pm
+
+=head1 SYNOPSIS
+
+See L<POE::Loop>.
+
+=head1 DESCRIPTION
+
+POE::Loop::Event implements the interface documented in L<POE::Loop>.
+Therefore it has no documentation of its own.  Please see L<POE::Loop>
+for more details.
+
+=head1 SEE ALSO
+
+L<POE>, L<POE::Loop>, L<Event>, L<POE::Loop::PerlSignals>
+
+=head1 AUTHORS & LICENSING
+
+Please see L<POE> for more information about authors, contributors,
+and POE's licensing.
+
+=cut
+
+# rocco // vim: ts=2 sw=2 expandtab
+# TODO - Edit.

Added: branches/upstream/libpoe-loop-event-perl/current/t/00_info.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libpoe-loop-event-perl/current/t/00_info.t?rev=45264&op=file
==============================================================================
--- branches/upstream/libpoe-loop-event-perl/current/t/00_info.t (added)
+++ branches/upstream/libpoe-loop-event-perl/current/t/00_info.t Sat Oct  3 16:01:36 2009
@@ -1,0 +1,9 @@
+#!/usr/bin/perl
+use strict; use warnings;
+
+use Test::More tests => 1;
+use_ok( 'POE' );
+
+# idea from Test::Harness, thanks!
+diag("Testing POE $POE::VERSION, Perl $], $^X on $^O");
+




More information about the Pkg-perl-cvs-commits mailing list