Changeset 10612


Ignore:
Timestamp:
02/08/10 00:13:24 (2 years ago)
Author:
azawawi
Message:

Perl tidy

Location:
trunk/Padre/lib/Padre
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Padre/lib/Padre/Action/File.pm

    r10611 r10612  
    127127 
    128128    Padre::Action->new( 
    129         name       => 'file.open_with_default_system_editor', 
    130         label      => Wx::gettext('Open with Default System Editor'), 
     129        name        => 'file.open_with_default_system_editor', 
     130        label       => Wx::gettext('Open with Default System Editor'), 
    131131        need_editor => 1, 
    132132        need_file   => 1, 
    133         comment    => Wx::gettext('Opens the file with the default system editor'), 
    134         menu_event => sub { 
     133        comment     => Wx::gettext('Opens the file with the default system editor'), 
     134        menu_event  => sub { 
    135135            my $document = $_[0]->current->document or return; 
    136136            $_[0]->on_open_with_default_system_editor( $document->filename ); 
  • trunk/Padre/lib/Padre/Document.pm

    r10608 r10612  
    222222        $self->{filename} = $self->{file}->{filename}; 
    223223 
    224         # TODO: Fix Ticket #845 here. We need to make sure only the filename and not the folder name is here.  
    225         # This causes F5 to fail as the get_command in Document::Perl doesn' handle this corretly    
     224        # TODO: Fix Ticket #845 here. We need to make sure only the filename and not the folder name is here. 
     225        # This causes F5 to fail as the get_command in Document::Perl doesn' handle this corretly 
    226226 
    227227        if ( $self->{file}->exists ) { 
  • trunk/Padre/lib/Padre/Document/Perl.pm

    r10607 r10612  
    319319    my $dir = File::Basename::dirname($filename); 
    320320    chdir $dir; 
    321      
     321 
    322322    return $debug 
    323323        ? qq{"$perl" -Mdiagnostics(-traceonly) $run_args{interpreter} "$filename"$Script_Args} 
  • trunk/Padre/lib/Padre/Wx/Directory/OpenInFileBrowserAction.pm

    r10611 r10612  
    3030        # On Windows, if we don't have STDIN/STDOUT, avoid IPC::Open3 
    3131        # because it crashes when launching a non-console app 
    32         if ( Padre::Constant::WIN32 ) { 
     32        if (Padre::Constant::WIN32) { 
    3333            system( $cmd, @cmd_args ); # we know that Explorer.exe will quit quickly 
    3434        } else { 
     
    5959    my $main = Padre::Current->main; 
    6060 
    61     unless( $filename ) { 
     61    unless ($filename) { 
    6262        $main->error( Wx::gettext("No filename") ); 
    6363        return; 
     
    7676 
    7777        # Unsupported 
    78         $error = sprintf(Wx::gettext("Unsupported OS: %s"), '$^O'); 
     78        $error = sprintf( Wx::gettext("Unsupported OS: %s"), '$^O' ); 
    7979    } 
    8080 
    81     if ( $error ) { 
    82         $main->error( $error ); 
     81    if ($error) { 
     82        $main->error($error); 
    8383    } 
    8484 
     
    9090# 
    9191sub open_with_default_system_editor { 
    92     my ($self, $filename) = @_; 
     92    my ( $self, $filename ) = @_; 
    9393 
    9494    my $main = Padre::Current->main; 
    95     unless( $filename ) { 
     95    unless ($filename) { 
    9696        $main->error( Wx::gettext("No filename") ); 
    9797        return; 
    9898    } 
    99      
     99 
    100100    my $error; 
    101     if(Padre::Constant::WIN32) { 
     101    if (Padre::Constant::WIN32) { 
     102 
    102103        # Win32 
    103104        require Padre::Util::Win32; 
     
    106107            file       => $filename, 
    107108            parameters => '', 
    108             show       => 1); 
    109     } elsif(Padre::Constant::UNIX) { 
     109            show       => 1 
     110        ); 
     111    } elsif (Padre::Constant::UNIX) { 
     112 
    110113        # Unix 
    111114        $error = $self->_execute_in_file_mananger($filename); 
    112115    } else { 
     116 
    113117        # Unsupported 
    114         $error = sprintf(Wx::gettext("Unsupported OS: %s"), '$^O'); 
    115     } 
    116      
    117     if ( $error ) { 
    118         $main->error( $error ); 
     118        $error = sprintf( Wx::gettext("Unsupported OS: %s"), '$^O' ); 
    119119    } 
    120120 
    121     return;  
     121    if ($error) { 
     122        $main->error($error); 
     123    } 
     124 
     125    return; 
    122126} 
    123127 
     
    128132    die "Only to be called in UNIX!" unless Padre::Constant::UNIX; 
    129133 
    130     my ($self, $filename) = @_; 
    131      
     134    my ( $self, $filename ) = @_; 
     135 
    132136    my $error; 
    133137    if ( defined $ENV{KDE_FULL_SESSION} ) { 
  • trunk/Padre/lib/Padre/Wx/Main.pm

    r10611 r10612  
    23902390            SCOPE: { 
    23912391                require File::pushd; 
     2392 
    23922393                # Ticket #845 this project_dir is created in correctly when you do padre somedir/script.pl and run F5 on that 
    23932394                # real stupid think so we don't crash 
     
    23952396                # The other part of this fix is in lib/Padre/Document/Perl.pm in get_command 
    23962397                # Please feel free to fix this 
    2397                 my $pushd = File::pushd::pushd( $document->project_dir) if -e $document->project_dir; 
     2398                my $pushd = File::pushd::pushd( $document->project_dir ) if -e $document->project_dir; 
    23982399                $self->run_command($cmd); 
    23992400            } 
     
    24092410                SCOPE: { 
    24102411                    require File::pushd; 
    2411                     my $pushd = File::pushd::pushd( $document->project_dir ) if -e  $document->project_dir; 
     2412                    my $pushd = File::pushd::pushd( $document->project_dir ) if -e $document->project_dir; 
    24122413                    $self->run_command($cmd); 
    24132414                } 
Note: See TracChangeset for help on using the changeset viewer.