source: extensions/pLoader/trunk/src/pLoader.pl @ 11239

Last change on this file since 11239 was 6426, checked in by ronosman, 14 years ago

Bug 1710 fixed : pLoader lack of concurrency support causes data inconsistency.

File size: 2.9 KB
Line 
1# +-----------------------------------------------------------------------+
2# | pLoader - a Perl photo uploader for Piwigo                            |
3# +-----------------------------------------------------------------------+
4# | Copyright(C) 2008-2010 Piwigo Team                  http://piwigo.org |
5# +-----------------------------------------------------------------------+
6# | This program is free software; you can redistribute it and/or modify  |
7# | it under the terms of the GNU General Public License as published by  |
8# | the Free Software Foundation                                          |
9# |                                                                       |
10# | This program is distributed in the hope that it will be useful, but   |
11# | WITHOUT ANY WARRANTY; without even the implied warranty of            |
12# | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
13# | General Public License for more details.                              |
14# |                                                                       |
15# | You should have received a copy of the GNU General Public License     |
16# | along with this program; if not, write to the Free Software           |
17# | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
18# | USA.                                                                  |
19# +-----------------------------------------------------------------------+
20
21use threads;
22use threads::shared;
23use strict;
24use File::Spec;
25use Wx;
26
27use Class::Accessor::Fast;
28use Uploader::GUI::App;
29use Uploader::GUI::Frame;
30use Uploader::GUI::Layout::GlobalSettings;
31use Uploader::GUI::Layout::Progress;
32use Uploader::GUI::Layout::Login;
33use Uploader::GUI::Layout::Reupload;
34use Uploader::GUI::Layout::PhotoProperties;
35use Uploader::GUI::Layout::PhotoPropertiesCategoriesTags;
36use Uploader::GUI::Layout::PhotoPropertiesExif;
37use Uploader::GUI::Layout::DestinationCategory;
38use JSON;
39use Wx::Locale qw/:default/;
40use Data::Dumper;
41use File::HomeDir;
42
43$SIG{__DIE__} = \&OnDieHandler;
44
45#eval {
46    my $app = Uploader::GUI::App->new(
47            {
48                root_dir      => $ENV{PLOADER_ROOT}||'..',
49                resource_dir => 'res',
50                locale_dir   => 'locale',
51                argv         => [ grep { -f $_ } @ARGV ],
52            }
53    );
54    #print "app->images ",$app->images;
55    $app->SetFrame( 
56        Uploader::GUI::Frame->new(
57            {
58                title     => sprintf("pLoader - Piwigo uploader %s - [%s]", $app->version, $app->connection->site_url),
59                pwg       => $app->pwg,
60                images    => $app->images,
61                preferences => $app->preferences,
62#                imageviewer_index => $app->imageviewerIndex,
63            }
64        )
65    );
66    $app->MainLoop();
67#};
68
69sub OnDieHandler {
70    my ( $exception ) = @_;
71   
72    # if triggered in eval
73    # return if $^S;
74    print $exception;
75}
761;
77
78
Note: See TracBrowser for help on using the repository browser.