init.py: Minor cleanups

This commit is contained in:
gergely.erdelyi 2008-08-30 17:39:07 +00:00
parent 8bac109f3b
commit 187f75d329

View File

@ -14,7 +14,6 @@
import os import os
import sys import sys
import time import time
import traceback
import warnings import warnings
import _idaapi import _idaapi
@ -111,8 +110,12 @@ from idautils import *
# Build up the ScriptBox tool # Build up the ScriptBox tool
#----------------------------------------------------------- #-----------------------------------------------------------
class ScriptBox(Choose): class ScriptBox(Choose):
def __init__(self, list=[]): def __init__(self, list=None):
Choose.__init__(self, list, "ScriptBox", 1) if list:
self.list = list
else:
self.list = []
Choose.__init__(self, self.list, "ScriptBox", 1)
self.width = 50 self.width = 50
def run(self): def run(self):
@ -130,7 +133,7 @@ class ScriptBox(Choose):
def addscript(self, scriptpath): def addscript(self, scriptpath):
self.list.append(scriptpath) self.list.append(scriptpath)
ScriptBox_instance = ScriptBox([]) ScriptBox_instance = ScriptBox()
#------------------------------------------------------------- #-------------------------------------------------------------
# Watchdog to catch runaway scripts after a specified timeout # Watchdog to catch runaway scripts after a specified timeout
@ -147,6 +150,7 @@ class WatchDog():
Python tracer-based watchdog class Python tracer-based watchdog class
""" """
def __init__(self, timeout=10): def __init__(self, timeout=10):
self.timestamp = 0
self.timeout = timeout self.timeout = timeout
self.installed = False self.installed = False
self.active = False self.active = False