1
1
#!/usr/bin/env python
3
# add-copyrights-to-images
5
5
# Copyright (C) 2011 Tim Marston <edam@waxworlds.org>
7
# This file is part of add-copyright-to-images (hereafter referred to as "this
9
# See http://www.waxworlds.org/edam/software/add-copyright-to-images for more
7
# This file is part of prep-images (hereafter referred to as "this program").
8
# See http://www.waxworlds.org/edam/software/gtk/prep-images for more
12
11
# This program is free software: you can redistribute it and/or modify
13
# it under the terms of the GNU Lesser General Public License as published
14
# by the Free Software Foundation, either version 3 of the License, or
12
# it under the terms of the GNU General Public License as published by
13
# the Free Software Foundation, either version 3 of the License, or
15
14
# (at your option) any later version.
17
16
# This program is distributed in the hope that it will be useful,
18
17
# but WITHOUT ANY WARRANTY; without even the implied warranty of
19
18
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20
# GNU Lesser General Public License for more details.
19
# GNU General Public License for more details.
22
# You should have received a copy of the GNU Lesser General Public License
21
# You should have received a copy of the GNU General Public License
23
22
# along with this program. If not, see <http://www.gnu.org/licenses/>.
30
29
from os.path import join, abspath, exists
32
31
# check for a development source directory and use that if it's there
33
PACKAGE_DIR = join( abspath( sys.path[ 0 ] ), ".." )
34
if exists( join( PACKAGE_DIR, "add_copyright_to_images", "prefs_dialog.py" ) ):
35
print "!!! using development packages !!!"
36
sys.path.insert( 0, PACKAGE_DIR )
32
PACKAGE_DIR = join( abspath( sys.path[ 0 ] ), "..", "lib" )
33
if exists( join( PACKAGE_DIR, "prep_images", "prefs_dialog.py" ) ):
34
print "!!! using development packages !!!"
35
sys.path.insert( 0, PACKAGE_DIR )
41
40
pygtk.require( '2.0' );
43
from add_copyright_to_images.main_window import *
42
from prep_images.main_window import *
46
45
if( len( sys.argv[ 1: ] ) == 0 ):
47
dialog = gtk.MessageDialog( None, gtk.DIALOG_MODAL, gtk.MESSAGE_INFO, \
48
gtk.BUTTONS_CLOSE, "No images specified" )
49
dialog.format_secondary_text( "You must select some files first!" )
46
dialog = gtk.MessageDialog( None, gtk.DIALOG_MODAL, gtk.MESSAGE_INFO, \
47
gtk.BUTTONS_CLOSE, "No images specified" )
48
dialog.format_secondary_text( "You must select some files first!" )
54
53
# process each image in turn
55
54
for filename in sys.argv[ 1: ]:
56
MainWindow( filename ).main()
55
MainWindow( filename ).main()