Changeset 10615
- Timestamp:
- 02/08/10 02:23:11 (5 weeks ago)
- Location:
- trunk/Padre
- Files:
-
- 1 added
- 9 modified
-
Changes (modified) (6 diffs)
-
dev.pl (modified) (5 diffs)
-
lib/Padre/Constant.pm (modified) (2 diffs)
-
lib/Padre/Plugin/PopularityContest.pm (modified) (1 diff)
-
lib/Padre/Plugin/PopularityContest/Ping.pm (modified) (2 diffs)
-
lib/Padre/Task/HTTPClient.pm (modified) (2 diffs)
-
lib/Padre/Util.pm (modified) (1 diff)
-
lib/Padre/Util/SVN.pm (added)
-
lib/Padre/Wx/Main.pm (modified) (4 diffs)
-
script/padre (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Padre/Changes
r10613 r10615 25 25 of the modules used by the Perl help provider run-time loaded (ADAMK) 26 26 - Moved padre.exe build from bin to win32-loader folder since bin is a 27 bad locationfor putting the Padre win32 launcher code (SMUELLER, AZAWAWI)27 bad path for putting the Padre win32 launcher code (SMUELLER, AZAWAWI) 28 28 - Added "Open in File Browser" in the File and right-click menu (AZAWAWI) 29 - No need to launch a command shell to execute explorer.exe on win32 (AZAWAWI) 29 - No need to launch a command shell to execute explorer.exe on 30 win32 (AZAWAWI) 30 31 - Added "Open with Default System Editor" in "File -> Open..." (AZAWAWI) 32 - Implemented padre --reset to flush and reset the current Padre 33 configuration in otherwise unrecoverable situations, such as now 34 when the Swarm plugin causes the slave-driver code to instantly 35 segfault at startup (ADAMK) 31 36 32 37 0.56 2010.02.01 … … 57 62 the invoker (AZAWAWI) 58 63 - Disable debugger menu items when there is no document (AZAWAWI) 59 - Fixed a Padre debugger crash when anunsaved document is debugged (AZAWAWI)64 - Fixed a Padre debugger crash when unsaved document is debugged (AZAWAWI) 60 65 - Fixed Padre no-document crash with Find Next/Find Previous functionality 61 66 (AZAWAWI) … … 205 210 - Ctrl-Tab behaviour is now configurable (SEWI) 206 211 - Rename Padre::Debug to Padre::Logger (SZABGAB) 207 - Reuse the comment field of the menu actions and show them in the toolbar (SZABGAB) 212 - Reuse the comment field of the menu actions and show them in 213 the toolbar (SZABGAB) 208 214 - Add comment field to all the menu items that did not have yet (SZABGAB) 209 215 - Integrated Padre::DB into the Padre::Locker API, so that we can do … … 212 218 being done in a transaction, or were doing crazy bizarre things. Startup 213 219 is now noticably faster (ADAMK) 214 - Added Preference setting to control autocomplete when editting a script rather than215 a Module. (PLAVEN)220 - Added Preference setting to control autocomplete when editting a 221 script rather than a Module. (PLAVEN) 216 222 217 223 0.52 2009.12.14 … … 347 353 - Fixed ticket #627: Suggestion: Make it possible to copy 'Syntax Check' 348 354 messages (AZAWAWI) 349 - require version 0.20 of Wx::Perl::ProcessStream to fix #628 (AZAWAWI, SZABGAB)355 - Require version 0.20 of Wx::Perl::ProcessStream to fix #628 (AZAWAWI, SZABGAB) 350 356 - Fixed ticket #493: splash image license not suitable for Debian (AZAWAWI) 351 357 - Fixed t/86-service.t to work again on win32 (AZAWAWI) … … 1198 1204 1199 1205 0.04 2008.08.08 1200 - add Devel::PerlySense as prereq 1201 - stop checking for wx version for now 1202 - change the create_makefile_pl to passthrough as the traditional did not do the extra work done by Build.PL 1206 - Add Devel::PerlySense as prereq 1207 - Stop checking for wx version for now 1208 - Change the create_makefile_pl to passthrough as the traditional did 1209 not do the extra work done by Build.PL 1203 1210 - Mark the buffer that is unsaved with a star. 1204 - stop saving the content of the loaded file and use GetModify1211 - Stop saving the content of the loaded file and use GetModify 1205 1212 to find out if the file has been modifyed since last save 1206 - replace the search_term by search_terms in the config file1207 - allow remembering of search terms1208 - replace the text dialog by a full dialog box and a Wx::ComboBox1213 - Replace the search_term by search_terms in the config file 1214 - Allow remembering of search terms 1215 - Replace the text dialog by a full dialog box and a Wx::ComboBox 1209 1216 - Setup http://padre.perlide.org/ using trac 1210 1217 - Move the repository to http://svn.perlide.org/padre/ 1211 1218 1212 1219 0.03_02 2008.08.03 1213 - add experimental code for plugins1214 - add experimental version of Padre::Plugin::PAR1215 - fix the shortcuts of some of the menues in windows, thanks to Octavian Rasnita1216 - replace the AppendSubMenu calls by Append calls to support older version of wxWidgets1220 - Add experimental code for plugins 1221 - Add experimental version of Padre::Plugin::PAR 1222 - Fix the shortcuts of some of the menues in windows, thanks to Octavian Rasnita 1223 - Replace the AppendSubMenu calls by Append calls to support older version of wxWidgets 1217 1224 1218 1225 0.03_01 2008.07.31 -
trunk/Padre/dev.pl
r10519 r10615 15 15 use Getopt::Long (); 16 16 use vars qw{ 17 $USAGE 17 18 $DEBUG 18 $TRACE19 $DIE20 19 $PROFILE 21 20 $PLUGINS 22 $USAGE23 21 $FULLTRACE 24 22 $INVISIBLE … … 27 25 28 26 BEGIN { 27 $USAGE = 0; 29 28 $DEBUG = 0; 30 $DIE = 0;31 29 $PROFILE = 0; 32 30 $PLUGINS = 0; 33 $USAGE = 0;34 31 $FULLTRACE = 0; 35 32 $INVISIBLE = 0; 36 33 @INCLUDE = (); 37 34 Getopt::Long::GetOptions( 38 'usage|help' => \$USAGE, 39 'debug|d' => \$DEBUG, 40 'trace' => sub { 41 $ENV{PADRE_DEBUG} = 1; 42 }, 43 'die' => \$DIE, 35 'usage|help' => \$USAGE, 36 'debug|d' => \$DEBUG, 37 'trace' => sub { $ENV{PADRE_DEBUG} = 1 }, 38 'die' => sub { $ENV{PADRE_DIE} = 1 }, 44 39 'profile' => \$PROFILE, 45 40 'a' => \$PLUGINS, … … 50 45 } 51 46 52 $USAGE and usage();53 54 47 $ENV{PADRE_DEV} = 1; 55 48 $ENV{PADRE_HOME} = $FindBin::Bin; 56 $ENV{PADRE_DIE} = $DIE;57 49 58 50 use lib $FindBin::Bin, "$FindBin::Bin/lib"; … … 90 82 91 83 if ($FULLTRACE) { 92 eval { require Devel::Trace; }; 84 eval { 85 require Devel::Trace; 86 }; 93 87 if ($@) { 94 88 print "Error while initilizing --fulltrace while trying to load Devel::Trace:\n" 95 89 . "$@Maybe Devel::Trace isn't installed?\n"; 96 exit 1;90 exit(1); 97 91 } 98 92 push @cmd, '-d:Trace'; … … 121 115 push @cmd, '--help' if $USAGE; 122 116 123 $DEBUG and print "Running " . join( ' ', @cmd ) . "\n"; 117 if ( $DEBUG ) { 118 print "Running " . join( ' ', @cmd ) . "\n"; 119 } 120 121 if ( $USAGE ) { 122 usage(); 123 } 124 124 125 125 system(@cmd); 126 126 127 127 sub vmsgfmt { 128 msgfmt( 129 { in => "$_[0]/share/locale/", 130 verbose => 0, 131 } 132 ); 128 msgfmt( { in => "$_[0]/share/locale/", verbose => 0 } ); 133 129 } 134 130 -
trunk/Padre/lib/Padre/Constant.pm
r10436 r10615 102 102 ); 103 103 104 use constant LOG_FILE => File::Spec->catfile( CONFIG_DIR, 'debug.log' );105 use constant PLUGIN_DIR => File::Spec->catdir( CONFIG_DIR, 'plugins' );106 use constant PLUGIN_LIB => File::Spec->catdir( PLUGIN_DIR, 'Padre', 'Plugin' );104 use constant LOG_FILE => File::Spec->catfile( CONFIG_DIR, 'debug.log' ); 105 use constant PLUGIN_DIR => File::Spec->catdir( CONFIG_DIR, 'plugins' ); 106 use constant PLUGIN_LIB => File::Spec->catdir( PLUGIN_DIR, 'Padre', 'Plugin' ); 107 107 use constant CONFIG_HOST => File::Spec->catfile( CONFIG_DIR, 'config.db' ); 108 108 use constant CONFIG_HUMAN => File::Spec->catfile( CONFIG_DIR, 'config.yml' ); 109 109 use constant CONFIG_STARTUP => File::Spec->catfile( CONFIG_DIR, 'startup.yml' ); 110 110 111 # Check and create the directories that need to exist 112 unless ( -e CONFIG_DIR or File::Path::mkpath(CONFIG_DIR) ) { 113 Carp::croak( "Cannot create config directory '" . CONFIG_DIR . "': $!" ); 111 # Do the initialisation in a function, 112 # so we can run it again later if needed. 113 sub init { 114 # Check and create the directories that need to exist 115 unless ( -e CONFIG_DIR or File::Path::mkpath(CONFIG_DIR) ) { 116 Carp::croak( "Cannot create config directory '" . CONFIG_DIR . "': $!" ); 117 } 118 unless ( -e PLUGIN_LIB or File::Path::mkpath(PLUGIN_LIB) ) { 119 Carp::croak( "Cannot create plug-ins directory '" . PLUGIN_LIB . "': $!" ); 120 } 114 121 } 115 unless ( -e PLUGIN_LIB or File::Path::mkpath(PLUGIN_LIB) ) { 116 Carp::croak( "Cannot create plug-ins directory '" . PLUGIN_LIB . "': $!" ); 122 123 BEGIN { 124 init(); 117 125 } 118 126 … … 132 140 # NOTE: The only reason this is here is that it is needed both during 133 141 # main configuration, and also during Padre::Startup. 134 use constant DEFAULT_SINGLEINSTANCE => ( WIN32 and not( $ENV{HARNESS_ACTIVE} or $^P ) ) ? 1 : 0; 142 use constant DEFAULT_SINGLEINSTANCE => ( 143 WIN32 and not( $ENV{HARNESS_ACTIVE} or $^P ) 144 ) ? 1 : 0; 135 145 136 146 use constant DEFAULT_SINGLEINSTANCE_PORT => 4444; 137 138 139 140 141 142 #####################################################################143 # Pseudo Constants144 145 my $revision;146 147 # Get the svn revision of the currently running Padre once:148 # eval 'use constant PADRE_REVISION => Padre::Util::revision;';149 # This needs to be a pseudo constant as it requires Padre::Util which150 # requires Padre::Constant (this module).151 sub PADRE_REVISION () {152 153 # Get and keep the revision at the first call of this pseudo-constant154 # (usually at Padre start)155 require Padre::Util;156 $revision ||= Padre::Util::revision();157 return $revision;158 }159 147 160 148 1; -
trunk/Padre/lib/Padre/Plugin/PopularityContest.pm
r10436 r10615 229 229 230 230 # Versioning information 231 my $revision = Padre::Constant::PADRE_REVISION; 231 require Padre::Util::SVN; 232 my $revision = Padre::Util::SVN::padre_revision(); 232 233 if ( defined $revision ) { 233 234 -
trunk/Padre/lib/Padre/Plugin/PopularityContest/Ping.pm
r10436 r10615 25 25 my $dir = $0; 26 26 $dir =~ s/padre$//; 27 my $revision = Padre::Util::svn_directory_revision($dir); 28 if ( -d "$dir.svn" ) { 29 $data{svn} = $revision; 30 } 27 require Padre::Util::SVN; 28 my $revision = Padre::Util::SVN::directory_revision($dir); 29 $data{svn} = $revision if -d "$dir.svn"; 31 30 } 32 31 … … 36 35 37 36 # Hand off to the parent constructor 38 return $class->SUPER::new( request => HTTP::Request->new( GET => $url->as_string ) ); 37 return $class->SUPER::new( 38 request => HTTP::Request->new( GET => $url->as_string ) 39 ); 39 40 } 40 41 -
trunk/Padre/lib/Padre/Task/HTTPClient.pm
r10436 r10615 4 4 use strict; 5 5 use warnings; 6 7 use Padre::Constant; 6 use Padre::Constant (); 8 7 9 8 # Use all modules which may provide services for us: 10 9 11 10 our $VERSION = '0.56'; 11 our @DRIVERS = qw{ 12 Padre::Task::HTTPClient::LWP 13 }; 12 14 13 15 =pod … … 41 43 42 44 sub new { 43 44 45 my $class = shift; 45 46 my %args = @_;47 48 return if ( !defined( $args{URL} ) ) or ( $args{URL} eq '' );46 my %args = @_; 47 unless ( defined $args{URL} and length $args{URL} ) { 48 return; 49 } 49 50 50 51 # Prepare information 51 $args{headers}->{'X-Padre'} ||= 'Padre version ' . $VERSION . ' ' . Padre::Constant::PADRE_REVISION;52 $args{method} ||= 'GET';53 54 my $self;52 require Padre::Util::SVN; 53 my $revision = Padre::Util::SVN::padre_version(); 54 $args{method} ||= 'GET'; 55 $args{headers}->{'X-Padre'} ||= "Padre version $VERSION $revision"; 55 56 56 57 # Each module will be tested and the first working one should return 57 58 # a object, all others should return nothing (undef) 58 for ('LWP') { 59 60 # require 'Padre/Task/HTTPClient/' . $_ . '.pm'; 61 eval 'require Padre::Task::HTTPClient::' . $_; 59 foreach my $driver ( @DRIVERS ) { 60 eval "require $driver;"; 62 61 next if $@; 63 $self = "Padre::Task::HTTPClient::$_"->new(%args); 64 next unless defined($self); 62 my $self = $driver->new(%args) or next; 65 63 return $self; 66 64 } 67 65 68 66 return; 69 70 67 } 71 68 -
trunk/Padre/lib/Padre/Util.pm
r10436 r10615 535 535 } 536 536 537 # TODO: A much better variant would be a constant set by svn.538 sub revision {539 if ( $0 =~ /padre$/ ) {540 my $dir = $0;541 $dir =~ s/padre$//;542 my $revision = Padre::Util::svn_directory_revision($dir);543 if ( -d "$dir.svn" ) {544 return 'r' . $revision;545 }546 }547 return;548 }549 550 537 1; 551 538 -
trunk/Padre/lib/Padre/Wx/Main.pm
r10612 r10615 1176 1176 1177 1177 sub refresh_title { 1178 my $self = shift; 1179 my $config = $self->{config}; 1180 my $current = $self->current; 1181 1182 my %variable_data = ( 1178 my $self = shift; 1179 my $config = $self->{config}; 1180 my $current = $self->current; 1181 my %variable = ( 1183 1182 '%' => '%', 1184 1183 'v' => $Padre::VERSION, 1185 'f' => '', # Init lize space for filename1186 'b' => '', # Init lize space for filename - basename1187 'd' => '', # Init lize space for filename - dirname1188 'F' => '', # Init lize space for filename relative to project dir1189 'p' => '', # Init lize space for project name1184 'f' => '', # Initialize space for filename 1185 'b' => '', # Initialize space for filename - basename 1186 'd' => '', # Initialize space for filename - dirname 1187 'F' => '', # Initialize space for filename relative to project dir 1188 'p' => '', # Initialize space for project name 1190 1189 ); 1191 1190 … … 1198 1197 my $document = $current->document; 1199 1198 my $file = $document->file; 1200 $variable_data{'f'} = $file->{filename}; 1201 $variable_data{'b'} = $file->basename; 1202 $variable_data{'d'} = $file->dirname; 1203 1204 $variable_data{'F'} = $file->{filename}; 1199 $variable{'f'} = $file->{filename}; 1200 $variable{'b'} = $file->basename; 1201 $variable{'d'} = $file->dirname; 1202 $variable{'F'} = $file->{filename}; 1205 1203 my $project_dir = $document->project_dir; 1206 1204 if ( defined $project_dir ) { 1207 1205 $project_dir = quotemeta $project_dir; 1208 $variable _data{'F'} =~ s/^$project_dir//;1206 $variable{'F'} =~ s/^$project_dir//; 1209 1207 } 1210 1208 } … … 1215 1213 'where id = ?', $self->ide->{session}, 1216 1214 ); 1217 $variable _data{'p'} = $session->name;1215 $variable{'p'} = $session->name; 1218 1216 } 1219 1217 … … 1221 1219 $self->{title} = $config->main_title; 1222 1220 1223 my $Vars = join( '', keys(%variable_data) ); 1224 1225 $self->{title} =~ s/\%([$Vars])/$variable_data{$1}/g; 1226 1227 $self->{title} = 'Padre ' . $Padre::VERSION 1228 if !defined( $self->{title} ); 1229 1230 my $revision = Padre::Constant::PADRE_REVISION; 1231 $self->{title} .= " SVN \@$revision (\$VERSION = $Padre::VERSION)" 1232 if defined($revision); 1221 my $variables = join '', keys %variable; 1222 $self->{title} =~ s/\%([$variables])/$variable{$1}/g; 1223 unless ( defined $self->{title} ) { 1224 $self->{title} = "Padre $Padre::VERSION"; 1225 } 1226 1227 require Padre::Util::SVN; 1228 my $revision = Padre::Util::SVN::padre_revision(); 1229 if ( defined $revision ) { 1230 $self->{title} .= " SVN \@$revision (\$VERSION = $Padre::VERSION)"; 1231 } 1233 1232 1234 1233 if ( $self->GetTitle ne $self->{title} ) { -
trunk/Padre/script/padre
r10259 r10615 4 4 use strict; 5 5 use warnings; 6 use File::Which (); 7 use Getopt::Long (); 8 use Carp (); 6 use Carp (); 9 7 10 8 local $| = 1; … … 16 14 # Must run using wxPerl on OS X. 17 15 if ( $^O eq 'darwin' and $^X !~ m{/wxPerl\.app/} ) { 16 require File::Which; 18 17 my $perl = scalar File::Which::which('wxPerl'); 19 18 chomp($perl); … … 29 28 # Handle special command line cases early, because options like --home 30 29 # MUST be processed before the Padre.pm library is loaded. 31 my $USAGE = ''; 32 my $VERSION = ''; 33 my $HOME = undef; 34 my $SESSION = undef; 35 my $PRELOAD = undef; 36 my $DESKTOP = undef; 37 my $ACTIONQUEUE = undef; 38 my $getopt = Getopt::Long::GetOptions( 30 require Getopt::Long; 31 my $USAGE = ''; 32 my $VERSION = ''; 33 my $HOME = undef; 34 my $RESET = undef; 35 my $SESSION = undef; 36 my $PRELOAD = undef; 37 my $DESKTOP = undef; 38 my $ACTIONS = undef; 39 my $getopt = Getopt::Long::GetOptions( 39 40 'help|usage' => \$USAGE, 40 41 'version' => \$VERSION, 41 42 'home=s' => \$HOME, 43 'reset' => \$RESET, 42 44 'session=s' => \$SESSION, 43 45 'desktop' => \$DESKTOP, 44 'actionqueue=s' => \$ACTIONQUEUE, 45 46 # Keep this secret for now --ADAMK 47 'preload' => \$PRELOAD, 46 'actionqueue=s' => \$ACTIONS, 47 'preload' => \$PRELOAD, # Keep this sekrit for now --ADAMK 48 48 ); 49 49 50 if ( $USAGE or !$getopt ) { 50 51 52 53 54 ##################################################################### 55 # Special Execution Modules 56 57 # Padre command line usage 58 if ( $USAGE or not $getopt ) { 51 59 print <<"END_USAGE"; 52 60 Usage: $0 [FILENAMES] 53 61 54 --home=dir Forces Padre's "home" directory to a specific location55 62 --help Shows this help message 63 --home=dir Forces Padre "home" directory to a specific location 64 --reset Flush entire local config directory and reset to defaults 56 65 --session=name Open given session during Padre startup 57 66 --version Prints Padre version and quits … … 63 72 } 64 73 65 local $ENV{PADRE_HOME} = defined($HOME) ? $HOME : $ENV{PADRE_HOME}; 66 67 # Special execution modes 74 # Padre version 68 75 if ($VERSION) { 69 76 my $msg = "Perl Application Development and Refactoring Environment $Padre::VERSION\n"; … … 84 91 } 85 92 93 # Lock in the home and constants, which are needed for everything else 94 local $ENV{PADRE_HOME} = defined($HOME) ? $HOME : $ENV{PADRE_HOME}; 95 require Padre::Constant; 96 97 # Destroy and reinitialise our config directory 98 if ($RESET) { 99 require File::Remove; 100 File::Remove::remove( \1, Padre::Constant::CONFIG_DIR() ); 101 Padre::Constant::init(); 102 } 103 86 104 if ($DESKTOP) { 87 105 require Padre::Desktop; 88 106 unless ( Padre::Desktop::desktop() ) { 89 warn "--desktop not implemented for " . $^O . "\n";107 warn "--desktop not implemented for $^O\n"; 90 108 } 91 109 exit(1); … … 97 115 # local $ENV{PADRE_PAR_PATH} = $ENV{PAR_TEMP} || ''; 98 116 99 my %opts = (100 files => \@ARGV,101 session => $SESSION,102 actionqueue => $ACTIONQUEUE,103 );104 105 117 # If we have an action queue then we are running for automation reasons. 106 118 # Avoid the startup logic and continue to the main startup. 107 unless ( defined $ACTION QUEUE) {119 unless ( defined $ACTIONS ) { 108 120 109 121 # Run the Padre startup sequence before we load the main application … … 125 137 126 138 # Build the application 127 my $app = Padre->new(%opts); 128 unless ($app) { 129 die "Failed to create Padre instance"; 130 } 139 my $ide = Padre->new( 140 files => \@ARGV, 141 session => $SESSION, 142 actionqueue => $ACTIONS, 143 ) or die "Failed to create Padre instance"; 131 144 132 145 # Start the application 133 $ app->run;146 $ide->run; 134 147 135 148 # Copyright 2008-2010 The Padre development team as listed in Padre.pm.
