gremlin/gremlin.in: Attach a name to the FormatSpec parser.
[autoys] / gremlin / gremlin.in
index 84429b7..ce5492e 100644 (file)
@@ -41,7 +41,7 @@ import shutil as SH
 import optparse as OP
 import threading as TH
 import shlex as L
-from math import sqrt
+from math import sqrt, ceil
 from contextlib import contextmanager
 
 ## eyeD3 tag fettling.
@@ -247,7 +247,7 @@ class ProgressEyecandy (object):
     ## Work out -- well, guess -- the time remaining.
     if cur:
       t = T.time()
-      eta = me._fmt_time((t - me._start)*(max - cur)/cur)
+      eta = me._fmt_time(ceil((t - me._start)*(max - cur)/cur))
     else:
       eta = '???'
 
@@ -411,6 +411,8 @@ class FormatParser (P.ParserElement):
   named format and its superclasses.
   """
 
+  name = 'format-spec'
+
   ## We cache the parser elements we generate to avoid enormous consing.
   CACHE = {}
 
@@ -1107,8 +1109,8 @@ class OggVorbisFormat (AudioFormat):
       for q, br in me.QMAP:
         if br >= me.bitrate:
           break
-        else:
-          raise ValueError, 'no suitable quality setting found'
+      else:
+        raise ValueError, 'no suitable quality setting found'
       encprops['quality'] = q/10.0
     return [make_element('vorbisenc', **encprops),
             make_element('oggmux')]