~ubuntu-branches/ubuntu/utopic/mutagen/utopic-proposed

« back to all changes in this revision

Viewing changes to tools/mutagen-inspect

  • Committer: Package Import Robot
  • Author(s): Daniel T Chen
  • Date: 2013-11-27 22:10:48 UTC
  • mfrom: (8.1.17 sid)
  • Revision ID: package-import@ubuntu.com-20131127221048-ae2f5j42ak2ox3kw
Tags: 1.22-1ubuntu1
* Merge from Debian unstable.  Remaining changes:
  - debian/control: Drop faad and oggz-tools build dependencies (in
    universe).

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
# This program is free software; you can redistribute it and/or modify
6
6
# it under the terms of version 2 of the GNU General Public License as
7
7
# published by the Free Software Foundation.
8
 
#
9
 
# $Id: mutagen-inspect 3839 2006-09-11 03:34:43Z piman $
10
8
 
11
 
import os
12
9
import sys
13
10
import locale
14
11
 
15
12
from optparse import OptionParser
16
13
 
 
14
 
17
15
def main(argv):
18
16
    from mutagen import File
19
17
 
29
27
    enc = locale.getpreferredencoding()
30
28
    for filename in args:
31
29
        print "--", filename
32
 
        try: print "- " + File(filename).pprint().encode(enc, 'replace')
33
 
        except AttributeError: print "- Unknown file type"
34
 
        except KeyboardInterrupt: raise
35
 
        except Exception, err: print str(err)
 
30
        try:
 
31
            print "- " + File(filename).pprint().encode(enc, 'replace')
 
32
        except AttributeError:
 
33
            print "- Unknown file type"
 
34
        except KeyboardInterrupt:
 
35
            raise
 
36
        except Exception, err:
 
37
            print str(err)
36
38
        print
37
39
 
 
40
 
38
41
if __name__ == "__main__":
39
 
    try: import mutagen
40
 
    except ImportError:
41
 
        # Run as ./mid3v2 out of tools/
42
 
        sys.path.append(os.path.abspath("../"))
43
 
        import mutagen
44
42
    main(sys.argv)