• R/O
  • SSH
  • HTTPS

rbphoto: Commit


Commit MetaInfo

Revisão55 (tree)
Hora2009-06-08 22:28:44
Autortach

Mensagem de Log

  • Change 'help' and 'version' instance method to class method on
    RbPhoto::Import class
  • Change load timing for gtk library

Mudança Sumário

Diff

--- rbphoto/trunk/lib/rbphoto/import.rb (revision 54)
+++ rbphoto/trunk/lib/rbphoto/import.rb (revision 55)
@@ -24,7 +24,6 @@
2424 require 'find'
2525 require 'exif'
2626 require 'gettext'
27-require 'gtk2'
2827 require 'rbphoto'
2928
3029 class Exif
@@ -39,17 +38,40 @@
3938 class Import
4039 include GetText
4140 bindtextdomain("rbphoto")
41+
42+ def self.help
43+ return <<_EOT
44+Usage: #{$0} [options] src_(dir|file)[s]... target_dir
45+Copy photo image from src to target. it renames photo file name
46+not to duplicate by its exif data.
4247
48+Options:
49+ -D, --datedir copy/move photos with datedir
50+ -f, --force force to overwrite when move
51+ -G, --no-gui disable GTK2+ graphical interface
52+ -m, --move move photos instead of copy
53+ -M, --with-movie process not only images but also movies
54+ -N, --without-rename do not rename photo files
55+ -p, --photographer=id set photographer id (default: $USER)
56+ -n, --no-act do not copy/move only test
57+ -h, --help show this help
58+ -v, --verbose make verbose output
59+ -V, --version show software version
60+_EOT
61+ end
62+
63+ def self.version
64+ return <<_EOT
65+Robust Photo management tool (import) #{RbPhoto::VERSION}
66+
67+Copyright (C) Taku YASUI <tach@debian.or.jp>
68+This is free software; see the source for copying conditions. There is NO
69+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
70+_EOT
71+ end
72+
4373 def initialize(opt)
4474 @opt = opt
45-
46- if ( @opt.version )
47- print self.version
48- exit
49- elsif ( @opt.help )
50- print self.help
51- exit
52- end
5375 end
5476
5577 def show_error(str)
@@ -149,35 +171,13 @@
149171 datedir = '/' + time.strftime('%Y-%m-%d') if ( @opt.datedir )
150172 return @dstdir + datedir + "/#{time.strftime('%Y%m%d-%H%M%S')}#{@postfix}.#{suffix}"
151173 end
152-
174+
153175 def help
154- return <<_EOT
155-Usage: #{$0} [options] src_(dir|file)[s]... target_dir
156-Copy photo image from src to target. it renames photo file name
157-not to duplicate by its exif data.
158-
159-Options:
160- -D, --datedir copy/move photos with datedir
161- -f, --force force to overwrite when move
162- -m, --move move photos instead of copy
163- -M, --with-movie process not only images but also movies
164- -N, --without-rename do not rename photo files
165- -p, --photographer=id set photographer id (default: $USER)
166- -n, --no-act do not copy/move only test
167- -h, --help show this help
168- -v, --verbose make verbose output
169- -V, --version show software version
170-_EOT
176+ self.class.help
171177 end
172178
173179 def version
174- return <<_EOT
175-Robust Photo management tool (import) #{RbPhoto::VERSION}
176-
177-Copyright (C) Taku YASUI <tach@debian.or.jp>
178-This is free software; see the source for copying conditions. There is NO
179-warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
180-_EOT
180+ self.class.version
181181 end
182182
183183 class Options < Hash
Show on old repository browser