4 def get_percent(self
, line
):
9 self
.re_progress
= re
.compile(".*([ 0-9][0-9])%")
12 def get_percent(self
, line
):
13 x
= self
.re_progress
.match(line
)
15 self
.percent
= int(x
.group(1))
22 self
.re_start_sec
= re
.compile(".*from sector +([0-9]+)")
23 self
.re_end_sec
= re
.compile(".*to sector +([0-9]+)")
24 self
.re_progress
= re
.compile("##: -2 \[wrote\] @ ([0-9]+)")
27 def get_percent(self
, line
):
28 if self
.start_sec
is None:
29 x
= self
.re_start_sec
.match(line
)
31 self
.start_sec
= int(x
.group(1))
32 if self
.end_sec
is None:
33 x
= self
.re_end_sec
.match(line
)
35 self
.end_sec
= int(x
.group(1))
36 if self
.start_sec
is not None and self
.end_sec
is not None:
37 x
= self
.re_progress
.match(line
)
39 self
.percent
= 100 * (int(x
.group(1))/1176-self
.start_sec
) / (self
.end_sec
-self
.start_sec
)
44 self
.re_progress
= re
.compile(r
"^[\s]+([0-9]+)/([0-9]+)")
47 def get_percent(self
, line
):
48 x
= self
.re_progress
.match(line
)
50 self
.percent
= int(100 * (float(x
.group(1)) / float(x
.group(2))))
55 self
.re_progress
= re
.compile('^.*\[[\s]*([.0-9]+)%\]')
58 def get_percent(self
, line
):
59 x
= self
.re_progress
.match(line
)
61 self
.percent
= int(float(x
.group(1)))
66 'cdparanoia': cdparanoia
,
72 def get_handler(text
):
75 return codecs
[codec
]()
76 return codecs
['generic']()