/gtk/prep-images

To get this branch, use:
bzr branch http://bzr.ed.am/gtk/prep-images

« back to all changes in this revision

Viewing changes to src/scripts/add-copyright-to-images.in

  • Committer: edam
  • Date: 2011-02-23 20:18:38 UTC
  • Revision ID: edam@waxworlds.org-20110223201838-u1jc3vc4ogw933sh
- ignore built files

Show diffs side-by-side

added added

removed removed

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