Victor Stinner avatar Victor Stinner committed f4874c4

hachoir-metadata: remove unused variables and imports

Comments (0)

Files changed (9)

hachoir-metadata/hachoir_metadata/audio.py

 from hachoir_parser.container import OggFile, RealMediaFile
 from hachoir_core.i18n import _
 from hachoir_core.tools import makePrintable, timedelta2seconds, humanBitRate
-from datetime import timedelta, date
+from datetime import timedelta
 from hachoir_metadata.metadata_item import QUALITY_FAST, QUALITY_NORMAL, QUALITY_BEST
 from hachoir_metadata.safe import fault_tolerant, getValue
 

hachoir-metadata/hachoir_metadata/filter.py

 from hachoir_metadata.timezone import UTC
-from datetime import date, datetime, timedelta
+from datetime import date, datetime
 
 # Year in 1850..2030
 MIN_YEAR = 1850

hachoir-metadata/hachoir_metadata/image.py

 from hachoir_parser.image.png import getBitsPerPixel as pngBitsPerPixel
 from hachoir_parser.image.xcf import XcfProperty
 from hachoir_core.i18n import _
-from hachoir_core.error import HACHOIR_ERRORS
 from hachoir_metadata.safe import fault_tolerant
 
 def computeComprRate(meta, compr_size):
 
     def useIFD(self, ifd):
         for field in ifd:
-            key = field.name
             try:
                 attrname = self.key_to_attr[field.name]
             except KeyError:

hachoir-metadata/hachoir_metadata/jpeg.py

 from hachoir_core.field import MissingField
 from hachoir_core.i18n import _
 from hachoir_core.tools import makeUnicode
-from hachoir_metadata.safe import fault_tolerant, getValue
+from hachoir_metadata.safe import fault_tolerant
 from datetime import datetime
-import operator
 
 def deg2float(degree, minute, second):
     return degree + (float(minute) + float(second) / 60.0) / 60.0
             return
 
         # Read value
-        rational = False
         if "value" in entry:
             value = entry["value"].value
         else:

hachoir-metadata/hachoir_metadata/metadata.py

 from hachoir_core.i18n import _
 from hachoir_core.log import Logger
 from hachoir_metadata.metadata_item import (
-    Data, MIN_PRIORITY, MAX_PRIORITY, QUALITY_NORMAL)
+    MIN_PRIORITY, MAX_PRIORITY, QUALITY_NORMAL)
 from hachoir_metadata.register import registerAllItems
-import re
 
 extractors = {}
 

hachoir-metadata/hachoir_metadata/register.py

 from hachoir_core.i18n import _
 from hachoir_core.tools import (
-    humanDuration, makePrintable, humanBitRate,
+    humanDuration, humanBitRate,
     humanFrequency, humanBitSize, humanFilesize,
     humanDatetime)
 from hachoir_core.language import Language

hachoir-metadata/hachoir_metadata/safe.py

-from hachoir_core.error import HACHOIR_ERRORS, warning, error
+from hachoir_core.error import HACHOIR_ERRORS, warning
 
 def fault_tolerant(func, *args):
     def safe_func(*args, **kw):

hachoir-metadata/hachoir_metadata/video.py

 from hachoir_core.field import MissingField
-from hachoir_core.error import HachoirError
 from hachoir_metadata.metadata import (registerExtractor,
     Metadata, RootMetadata, MultipleMetadata)
 from hachoir_metadata.metadata_item import QUALITY_GOOD
 from hachoir_parser.container.mkv import dateToDatetime
 from hachoir_core.i18n import _
 from hachoir_core.tools import makeUnicode, makePrintable, timedelta2seconds
-from hachoir_core.error import warning
 from datetime import timedelta
 
 class MkvMetadata(MultipleMetadata):
 
     def processHeader(self, header):
         compression = []
-        bit_rates = []
         is_vbr = None
 
         if "ext_desc/content" in header:

hachoir-metadata/metadata_csv.py

 from hachoir_parser import createParser
 from hachoir_core.tools import makePrintable
 from hachoir_metadata import extractMetadata
-from hachoir_core.i18n import initLocale, getTerminalCharset
+from hachoir_core.i18n import initLocale
 from sys import argv, stderr, exit
 from os import walk
 from os.path import join as path_join
 from fnmatch import fnmatch
-from datetime import datetime
 import codecs
 
-
 OUTPUT_FILENAME = "metadata.csv"
 
 class Extractor:
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.