Added Needle, a general thread class
This commit is contained in:
parent
60d3e58688
commit
b33e02ee48
|
@ -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)
|
|
@ -63,6 +63,7 @@ def parseInput():
|
||||||
# Set verbose first so we can use write()
|
# Set verbose first so we can use write()
|
||||||
set("VERBOSE", ('-v' in sys.argv) or ("--verbose" in sys.argv) )
|
set("VERBOSE", ('-v' in sys.argv) or ("--verbose" in sys.argv) )
|
||||||
write("Setting default values...", True)
|
write("Setting default values...", True)
|
||||||
|
|
||||||
# Find who is running the program
|
# Find who is running the program
|
||||||
user = os.path.expanduser("~")
|
user = os.path.expanduser("~")
|
||||||
user = os.path.join(user,".ocarina2")
|
user = os.path.join(user,".ocarina2")
|
||||||
|
|
|
@ -13,6 +13,7 @@ opt = []
|
||||||
|
|
||||||
import curses
|
import curses
|
||||||
from bt.message import write
|
from bt.message import write
|
||||||
|
from bt.needle import Needle
|
||||||
|
|
||||||
|
|
||||||
global maxxy, input, stdscr
|
global maxxy, input, stdscr
|
||||||
|
|
|
@ -0,0 +1,2 @@
|
||||||
|
__author__="bjschuma"
|
||||||
|
__date__ ="$Dec 19, 2009 9:13:05 PM$"
|
Loading…
Reference in New Issue