chiark / gitweb /
gremlin/gremlin.in: Refactor content-type guessing.
authorMark Wooding <mdw@distorted.org.uk>
Tue, 17 Apr 2018 21:33:54 +0000 (22:33 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Thu, 19 Apr 2018 11:22:49 +0000 (12:22 +0100)
Remove the `gf' temporary, which isn't really doing much of any good.

gremlin/gremlin.in

index 7b0e47de180699621c751505fe3233ecf03af4b6..0a76641b4d9cec2514ed7a2e0caf6653cbecf164 100644 (file)
@@ -1513,8 +1513,9 @@ def grobble(master, targets, noact = False):
           ## the appropriate categories.  Later, we'll apply policy to the
           ## files, by category, and work out what to do with them all.
           else:
-            gf = GIO.File(masterfile)
-            mime = gf.query_info('standard::content-type').get_content_type()
+            mime = GIO.File(masterfile) \
+                      .query_info('standard::content-type') \
+                      .get_content_type()
             cats = []
             for cat in pmap.iterkeys():
               id = cat.identify(masterfile, mime)