Changeset 396
- Timestamp:
- 04/24/07 02:48:24 (1 year ago)
- Files:
-
- SVN-TracWiki/examples/config.yaml (modified) (1 diff)
- SVN-TracWiki/lib/SVN/TracWiki.pm (modified) (2 diffs)
- SVN-TracWiki/lib/SVN/TracWiki/Plugin/Extract.pm (modified) (1 diff)
- SVN-TracWiki/lib/SVN/TracWiki/Plugin/Extract/PowerPoint.pm (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
SVN-TracWiki/examples/config.yaml
r391 r396 8 8 username: foo 9 9 password: bar 10 11 plugins: 12 PowerPoint: 13 ppthtml: /usr/local/bin/ppthtml SVN-TracWiki/lib/SVN/TracWiki.pm
r394 r396 61 61 62 62 Encode::_utf8_off($text) if Encode::is_utf8($text); 63 64 63 next if $r->mime_type eq 'text/plain' or $r->mime_type eq 'text/html'; 65 64 … … 75 74 76 75 my @plugins; 77 for ( $self->plugins ) { 78 next unless $_ =~ /SVN::TracWiki::Plugin::Extract::/; 79 my $plugin = $_->new; 80 81 my $e = $self->{extractor}; 82 my $ext = $plugin->ext; 83 $e->magic->add_file_ext($ext, $plugin->mime_type) if $ext; 84 $e->register_processor($_); 76 for my $class ( $self->plugins ) { 77 my ( $name ) = ( $class =~ /SVN::TracWiki::Plugin::Extract::(.+)/ ); 78 next unless $name; 79 80 my $e = $self->{extractor}; 81 my $ext = $class->ext; 82 my $mime_type = $class->mime_type; 83 $e->magic->add_file_ext($ext, $mime_type) if $ext; 84 $e->register_processor($class); 85 86 $class->mk_classdata('conf'); 87 $class->conf( $self->{config}->{plugins}->{$name} ); 85 88 } 86 89 } SVN-TracWiki/lib/SVN/TracWiki/Plugin/Extract.pm
r394 r396 3 3 use strict; 4 4 use warnings; 5 use base qw( File::Extract SVN::TracWiki::Plugin );5 use base qw( File::Extract SVN::TracWiki::Plugin Class::Data::Inheritable ); 6 6 7 7 sub mime_type { } SVN-TracWiki/lib/SVN/TracWiki/Plugin/Extract/PowerPoint.pm
r394 r396 13 13 my ( $self, $file ) = @_; 14 14 15 my $html = `/usr/local/bin/ppthtml $file`; 16 my $text = $self->strip_html($html); 15 my $ppthtml = $self->conf->{ppthtml} || '/usr/bin/ppthtml'; 16 my $html = `/usr/local/bin/ppthtml $file`; 17 my $text = $self->strip_html($html); 17 18 18 19 $text = Encode::decode('utf8', $text);
