Added Needle, a general thread class

This commit is contained in:
bjschuma 2009-12-19 21:38:24 -05:00
parent 60d3e58688
commit b33e02ee48
4 changed files with 24 additions and 0 deletions

20
src/base/bt/needle.py Normal file
View File

@ -0,0 +1,20 @@
#! /usr/bin/python
# To change this template, choose Tools | Templates
# and open the template in the editor.
__author__="bjschuma"
__date__ ="$Dec 19, 2009 9:30:59 PM$"
from threading import Thread
class Needle(Thread):
def __init__(self, func, args):
self.func = func
self.args = args
def run(self):
func(args)

View File

@ -63,6 +63,7 @@ def parseInput():
# Set verbose first so we can use write()
set("VERBOSE", ('-v' in sys.argv) or ("--verbose" in sys.argv) )
write("Setting default values...", True)
# Find who is running the program
user = os.path.expanduser("~")
user = os.path.join(user,".ocarina2")

View File

@ -13,6 +13,7 @@ opt = []
import curses
from bt.message import write
from bt.needle import Needle
global maxxy, input, stdscr

View File

@ -0,0 +1,2 @@
__author__="bjschuma"
__date__ ="$Dec 19, 2009 9:13:05 PM$"