Commits

Travis Shirk committed f7f42af

Added -Q/--quiet, although the output could be better.

Comments (0)

Files changed (2)

src/eyed3/main.py

                        help="Supply a configuration file. The default is "
                             "'%s', although even that is optional." %
                             DEFAULT_CONFIG)
+        p.add_argument("-Q", "--quiet", action="store_true", dest="quiet",
+                       default=False, help="A hint to plugins to output less.")
 
         p.add_argument("--fs-encoding", action="store",
                        dest="fs_encoding", default=eyed3.LOCAL_FS_ENCODING,

src/eyed3/plugins/classic.py

             return self.R_CONT
 
         try:
+            self.printHeader(f)
+            printMsg("-" * 79)
+
             new_tag = False
             if (not self.audio_file.tag or
                     self.handleRemoves(self.audio_file.tag)):
             save_tag = (self.handleEdits(self.audio_file.tag) or
                         self.args.force_update or self.args.convert_version)
 
-            self.printHeader(f)
             self.printAudioInfo(self.audio_file.info)
 
             if not save_tag and new_tag:
                 self.audio_file.rename(name)
                 printWarning("Renamed '%s' to '%s'" % (orig,
                                                        self.audio_file.path))
+            printMsg("-" * 79)
         except exceptions.Exception as ex:
             printError("Error: %s" % ex)
             log.error(traceback.format_exc())
         from stat import ST_SIZE
         file_size = os.stat(file_path)[ST_SIZE]
         size_str = utils.formatSize(file_size)
-        printMsg("")
         printMsg("%s\t%s[ %s ]%s" %
                  (boldText(os.path.basename(file_path), c=HEADER_COLOR),
                   getColor(HEADER_COLOR), size_str, getColor(RESET)))
-        printMsg("-" * 79)
 
     def printAudioInfo(self, info):
         if isinstance(info, mp3.Mp3AudioInfo):
 
     def printTag(self, tag):
         if isinstance(tag, id3.Tag):
+            if self.args.quiet:
+                printMsg("ID3 %s: %d frames" %
+                         (id3.versionToString(tag.version),
+                          len(tag.frame_set)))
+                return
+
             printMsg("ID3 %s:" % id3.versionToString(tag.version))
             artist = tag.artist if tag.artist else u""
             title = tag.title if tag.title else u""