diff --git a/lib/controller/checks.py b/lib/controller/checks.py index af6b97614..f2f0752e3 100644 --- a/lib/controller/checks.py +++ b/lib/controller/checks.py @@ -168,21 +168,27 @@ def checkDynamicContent(firstPage, secondPage): while i < len(blocks): block = blocks[i] (_, _, length) = block + if length <= conf.minMatchBlock: blocks.remove(block) + else: i += 1 if len(blocks) > 0: blocks.insert(0, None) blocks.append(None) + for i in xrange(len(blocks) - 1): prefix = firstPage[blocks[i][0]:blocks[i][0] + blocks[i][2]] if blocks[i] else None postfix = firstPage[blocks[i + 1][0]:blocks[i + 1][0] + blocks[i + 1][2]] if blocks[i + 1] else None + if prefix is None and blocks[i + 1][0] == 0: continue + if postfix is None and (blocks[i][0] + blocks[i][2] >= len(firstPage)): continue + kb.dynamicMarkings.append((prefix[-conf.dynMarkLength:] if prefix else None, postfix[:conf.dynMarkLength] if postfix else None)) if len(kb.dynamicMarkings) > 0: diff --git a/lib/core/common.py b/lib/core/common.py index 02c8b8053..ff13c1aa9 100644 --- a/lib/core/common.py +++ b/lib/core/common.py @@ -1503,13 +1503,9 @@ def beep(): if sys.platform=='linux2': try: audio=file('/dev/audio', 'wb') - count=0 - while count < 250: - beep=chr(32) * 4 - audio.write(beep) - beep=chr(0) * 4 - audio.write(beep) - count=count + 1 + for i in xrange(250): + audio.write(chr(32) * 4) + audio.write(chr(0) * 4) audio.close() except: print '\a'