![]() |
|< 1 ... 15 16 17 18 19 20 21 ... 54 >| | ![]() |
539 Einträge, 54 Seiten |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
sub output { my $panel = _ref(); $panel->AppendText( @_ ); } sub clear_output { my $panel = _ref(); $panel->Clear; } sub run { my $win = Kephra::App::Window::_ref(); my $doc = Kephra::Document::_get_current_file_path(); Kephra::File::save_current(); if ($doc) { clear_output(); my $proc = Wx::Perl::ProcessStream->OpenProcess(qq~perl "$doc"~ , 'Output-Extention', $win); } else { Kephra::App::StatusBar::info_msg( $Kephra::localisation{app}{menu}{document} . ' ' . $Kephra::localisation{app}{general}{untitled} . "\n" ); } }
my $proc = Wx::Perl::ProcessStream->OpenProcess(qq~perl "$doc"~ , 'Output-Extention', $win);
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
#.... use Cwd; use File::Spec::Functions ':ALL'; use File::HomeDir (); use File::UserConfig (); use File::Basename (); use Config::General (); use YAML::Tiny (); our $basedir; BEGIN{ $basedir = rel2abs( File::Basename::dirname( __FILE__ ) ); } use Wx; # Core wxWidgets Framework use Wx::STC; # Scintilla editor component #....
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
#... use Kephra::Extention::Output::Config; #... sub run { my $win = Kephra::App::Window::_ref(); my $doc = Kephra::Document::_get_current_file_path(); Kephra::File::save_current(); if ($doc) { clear_output(); my $type = Kephra::Document::SyntaxMode::get(); Kephra::Extention::Output::Config::load( $Kephra::basedir ); my $prog = Kephra::Extention::Output::Config::get( $type ) || 'perl'; my $proc = Wx::Perl::ProcessStream->OpenProcess(qq~"$prog" "$doc"~ , 'Output-Extention', $win); } else { Kephra::App::StatusBar::info_msg( $Kephra::localisation{app}{menu}{document} . ' ' . $Kephra::localisation{app}{general}{untitled} . "\n" ); } }
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
package Kephra::Extention::Output::Config; use strict; use warnings; use File::Spec; use YAML::Tiny; our $VERSION = 0.01; my %hash; sub load { my $basename = shift; my $conf = File::Spec->catfile( $basename, '..', 'config', 'extention', 'output', 'executables.yaml' ); my $ref = YAML::Tiny->read( $conf ); if( $ref and $ref->[0] ){ %hash = %{ $ref->[0] }; } } sub get { my ($key) = @_; return $hash{$key}; } 1;
lichtkind+2008-08-29 14:24:11--Kennst mich doch ;-)geh ich recht in der annahme das du damit nur passende interpreter je mode bestimmst? da kann einer wieder nicht abwarten.
QuoteIch kann mir so zu Modes wie "yaml" etc. eigene Programme drauflegen, die mir die Angaben validieren...welche brauchst den noch?
![]() |
|< 1 ... 15 16 17 18 19 20 21 ... 54 >| | ![]() |
539 Einträge, 54 Seiten |