Example #1
0
 def __init__(self, parsed):
     Thread.__init__(self)
     self.results = ParseEvaluator()
     self.parsed = parsed
     
     self.daemon = True
     self.start()
Example #2
0
 def __init__(self, newJobsQueue, updatedJobsQueue, boss):
     Thread.__init__(self)
     self.newJobsQueue = newJobsQueue
     self.updatedJobsQueue = updatedJobsQueue
     self.currentjobs = list()
     self.runningjobs = set()
     self.boss = boss
Example #3
0
    def __init__(self, tname, task_queue, flt, suc, fail, headers={}, proxy=None, proxy_policy=None,
            retry=3, timeout=10, logger=None, keep_alive=None, stream_mode=False):
        """
        Construct a new 'HttpWorker' obkect

        :param tname: The name of this http worker
        :param task_queue: The task Queue instance
        :param flt: the filter function
        :param suc: the function to call when succeeded
        :param fail: the function to call when failed
        :param headers: custom HTTP headers
        :param proxy: proxy dict
        :param proxy_policy: a function to determine whether proxy should be used
        :param retry: retry count
        :param timeout: timeout in seconds
        :param logger: the Logger instance
        :param keep_alive: the callback to send keep alive
        :param stream_mode: set the request to use stream mode, keep_alive will be called every iteration
        :return: returns nothing
        """
        HttpReq.__init__(self, headers, proxy, proxy_policy, retry, timeout, logger, tname = tname)
        Thread.__init__(self, name = tname)
        Thread.setDaemon(self, True)
        self.task_queue = task_queue
        self.logger = logger
        self._keepalive = keep_alive
        self._exit = lambda x: False
        self.flt = flt
        self.f_suc = suc
        self.f_fail = fail
        self.stream_mode = stream_mode
        # if we don't checkin in this zombie_threshold time, monitor will regard us as zombie
        self.zombie_threshold = timeout * (retry + 1) 
        self.run_once = False
Example #4
0
    def __init__(self, function, sleep=30):
        Thread.__init__(self)

        self.daemon = True
        self.sleepTime = sleep
        self.runTimer = True
        self.function = function
Example #5
0
 def __init__(self, req, proxy, logger, task, exit_check=None, ignored_errors=[]):
     Thread.__init__(self, name = "monitor%s" % task.guid)
     Thread.setDaemon(self, True)
     # the count of votes per error code
     self.vote_result = {}
     # the error code to be ignored
     self.vote_cleared = set().union(ignored_errors)
     self.thread_last_seen = {}
     self.dctlock = RLock()
     self.votelock = RLock()
     self.thread_ref = {}
     self.thread_zombie = set()
     # HttpReq instance
     self.req = req
     # proxy.Pool instance
     self.proxy = proxy
     self.logger = logger
     self.task = task
     self._exit = exit_check if exit_check else lambda x: False
     self._cleaning_up = False
     if os.name == "nt":
         self.set_title = lambda s:os.system("TITLE %s" % (
             s if PY3K else s.encode(CODEPAGE, 'replace')))
     elif os.name == 'posix':
         import sys
         self.set_title = lambda s:sys.stdout.write("\033]2;%s\007" % (
             s if PY3K else s.encode(CODEPAGE, 'replace')))
Example #6
0
 def __init__(self, port, deviceFd, deviceLock, debug = False, aexServer = None):
     '''
     Constructor
     '''
     self.running = False
     
     self.__dataQueue = Queue(0)
     
     self.__clients = []
     self.debug = debug
     
     self.__deviceFd = deviceFd
     self.deviceLock = deviceLock
     self.aexServer=aexServer
     
     self.runningTime = 0
     self.receivingTime = 0
     self.packetsReceived = 0
     self.sleepingTimes = 0
     
     ThreadingTCPServer.__init__(self, ("", port), StimNetCom, False)
     
     ThreadingTCPServer.allow_reuse_address = True
     
     self.server_bind()
     self.server_activate()
     
     Thread.__init__(self)
Example #7
0
 def __init__(self, interval_sec, get_connection_holders):
     Thread.__init__(self, name="Connection heartbeat")
     self._interval = interval_sec
     self._get_connection_holders = get_connection_holders
     self._shutdown_event = Event()
     self.daemon = True
     self.start()
 def __init__(self, server):
     """
     constructor
     @param      server to run
     """
     Thread.__init__(self)
     self.server = server
Example #9
0
    def __init__(self, prompt="> ", stdin=None, stdout=None):
        if _debug: ConsoleCmd._debug("__init__")
        cmd.Cmd.__init__(self, stdin=stdin, stdout=stdout)
        Thread.__init__(self, name="ConsoleCmd")

        # check to see if this is running interactive
        self.interactive = sys.__stdin__.isatty()

        # save the prompt for interactive sessions, otherwise be quiet
        if self.interactive:
            self.prompt = prompt
        else:
            self.prompt = ''

        # gc counters
        self.type2count = {}
        self.type2all = {}

        # logging handlers
        self.handlers = {}

        # set a INT signal handler, ^C will only get sent to the
        # main thread and there's no way to break the readline
        # call initiated by this thread - sigh
        if hasattr(signal, 'SIGINT'):
            signal.signal(signal.SIGINT, console_interrupt)

        # start the thread
        self.start()
Example #10
0
    def __init__(self, log = None):
        from threading import Event

        Thread.__init__(self)

        self.__mytid = P.mytid()

        try:
            ## get process ID of parent
            self.__parent = P.parent()
        except:
            self.__parent = None

        self.__bindings = {}
        self.__stop = 0
        self.__tasks = {}

        self.setMessageLoopDelay(0.1)
        self.__loopEvent = Event()

        if log: self.__log = Logfile()
        else: self.__log = None

        ## add ping-mechanism

        self.setPingTimeout(5.)
        self.bind(MSG_PING, -1, self._ping)
Example #11
0
 def __init__(self, name, event, function, args=[], period = 5.0):
     Thread.__init__(self)
     self.name = name
     self.stopped = event
     self.period = period
     self.function = function
     self.args = args
 def __init__(self, stationBase):
     Thread.__init__(self)
     self.stationBase = stationBase
     self.imageVirtuelle = None
     self.anciennePosRobot = []
     self.police = cv2.FONT_HERSHEY_SIMPLEX
     self.chargerImageVirtuelle()
Example #13
0
 def __init__(self, config, pipe_name=PIPE):
     """@param pipe_name: Cuckoo PIPE server name."""
     Thread.__init__(self)
     self.pipe_name = pipe_name
     self.config = config
     self.options = config.get_options()
     self.do_run = True
Example #14
0
 def __init__(self, scanner, files):
     IdleObject.__init__(self)
     Thread.__init__(self)
     self.files = files
     self.scanner = scanner
     self.daemon = True
     self.stop = False
 def __init__(self, params):
     Thread.__init__(self)
     self.tid          = params['tid']                              #work线程id
     self.apns_gateway = ApnsGateway(certfile=params['certfile'],   #apns连接
                                         host=params['host'],
                                         port=params['port'],
                                        retry=params['retry'])   
Example #16
0
 def __init__(self, host, port, tor):
     Thread.__init__(self)
     self.host = host
     self.port = port
     self.socks = socks.socksocket()
     self.tor = tor
     self.running = True
Example #17
0
 def __init__(self, model=None, ishome=False):
     IdleObject.__init__(self)
     Thread.__init__(self)
     self.model = model
     self.ishome = ishome
     self.daemon = True
     self.stop = False
Example #18
0
 def __init__ (self):
     Thread.__init__(self)
     self.status = 0.
     self.running = True
     self.datastr=0.
     self.Value=0.
     self.OldData=0.
Example #19
0
    def __init__(self, app, port, timeout=5):
        self.timeout = timeout
        Thread.__init__(self)
        self.app = app
        self.port = port
        if isinstance(app, object):
            self.name = app.__class__.__name__
        else:
            self.name = app.__name__

        from paste import httpserver
        self.server = httpserver.serve(self.app, host='127.0.0.1', port=str(self.port),
                         start_loop=False,
                         use_threadpool=True,
                         protocol_version="HTTP/1.1",
                         socket_timeout=5,
                         threadpool_options={
                                             "hung_thread_limit": 10,
                                             "kill_thread_limit" : 20,
                                             "dying_limit": 30,
                                             "hung_check_period" : 5
                                             
                                             }
                         )
        self.server.thread_pool.logger.setLevel(logging.WARN)
        if not hasattr(self.server, "timeout") or self.server.timeout is None:
            self.server.timeout = 1
        if self.server.timeout != 1:
            warn("server.timeout was changed from %d to 1" % (self.server.timeout))
            self.server.timeout = 1
        assert self.server.timeout == 1
        self.server.handle_timeout = _Watchdog(self.server, limit=self.timeout).getTimeoutHandler()
 def __init__(self,threadSum):
     Thread.__init__(self)
     sqldb = DB_Helper()#将序号重新恢复
     sqldb.updateID()
     self.pool =[]
     for i in range(threadSum):
         self.pool.append(Detect_Proxy(DB_Helper(),i+1,threadSum))
Example #21
0
 def __init__ (self, world, controller, sock):
     Thread.__init__(self)
     self.world = world
     self.controller = controller
     self._stop = Event()
     self.lock = Lock()
     self.sock = sock
Example #22
0
 def __init__(self, watchers, endpoint, pubsub_endpoint, check_delay=1.,
              prereload_fn=None, context=None, loop=None,
              stats_endpoint=None, plugins=None):
     Thread.__init__(self)
     Arbiter.__init__(self, watchers, endpoint, pubsub_endpoint,
                      check_delay, prereload_fn, context, loop,
                      stats_endpoint, plugins)
	def __init__(self):
		Thread.__init__(self)

		self.daemon = True

		# flush the input buffer
		ser.read(1000)
Example #24
0
    def __init__(self, sock):
        Thread.__init__(self)
        self.sendingQueue = Utils.globals.sendingQueue
        self.sock = sock
        self.ping = ""

        self.outfile = open("data_received_from_node.txt", 'w')
Example #25
0
    def __init__(self):
        Thread.__init__(self)
        self.daemon = True
        self.start()
        self.status = ''

        self._sleep_time = 0
    def __init__(self, sensor_name, sensor_type, serial):
        Thread.__init__(self)
        if sensor_name[-1] == '/':
            sensor_name = sensor_name[:-1]
        
        if (sensor_type == "Kinect2") or (sensor_type == "Kinectv2") or (sensor_type == "Kinect_v2"):
            self.kinect_type = "Kinect2"
            print "Loading Kinect2 with serial : "+serial 
            self.kinect = Kinect_v2(sensor_name,serial,queue_size=10,compression=False,use_rect=True,use_ir=True)
            
        elif (sensor_type == "Kinect") or (sensor_type == "Kinect1") or (sensor_type == "Kinectv1") or (sensor_type == "Kinect_v1"):
            self.kinect_type = "Kinect1"
            print "Loading "+sensor_name+" of type Kinect1"
            self.kinect = Kinect(sensor_name,queue_size=10,compression=False,use_rect=True,use_depth_registered=True,use_ir=False)
        else:
            print "ERROR: Sensor type must be Kinect2 or Kinect"
            return       
        
        self.sensor_name = sensor_name

        self.kinect.wait_until_ready()
        
        self.listener = tf.TransformListener()
        
        self.list_robot_links = ['link_0','link_1','link_2','link_3','link_4','link_5','link_6','link_7']
        
        self.last_pose = None
        
        rospy.Subscriber("/kinect_merge/tracking_state", MarkerArray , self.callback)
Example #27
0
 def __init__(self, proxy, url, file):
     Thread.__init__(self)
     self.proxy = proxy
     self.url = url
     self.file = file
     self.result = False
     self.data = ""
Example #28
0
  def __init__(self, app, baseurl, mount, cacertdir = "/etc/grid-security/certificates", minreq = 1000, interval = 300, instance = "test"):
    Thread.__init__(self, name = "LdapSync")
    self.sectoken = "".join(random.sample(string.letters, 30))
    self._inturl = "http://localhost:%d%s/%s/ldapsync" % \
                   (app.srvconfig.port, mount, instance)
    self._headers = \
      fake_authz_headers(open(app.srvconfig.tools.cms_auth.key_file).read(),
                         method = "Internal", login = self.sectoken,
                         name = self.__class__.__name__, dn = None,
                         roles = {"Global Admin": {"group": ["global"]}}) \
      + [("Accept", "application/json")]

    self._cv = Condition()
    if isinstance(baseurl, str):
      self._baseurl = baseurl

    self._cacertdir = cacertdir
    self._minreq = minreq
    self._interval = interval
    self._stopme = False
    self._full = (0, [], [])
    self._warnings = {}

    self._intreq = RequestManager(num_connections = 2,
                                  user_agent = self._ident,
                                  handle_init = self._handle_init,
                                  request_respond = self._respond,
                                  request_init = self._int_init)
    cherrypy.engine.subscribe("stop", self.stop)
    cherrypy.engine.subscribe("start", self.start)
Example #29
0
    def __init__(self, files, outDir, dirFormat, fileFormat,
                 anon=dict(), keep_filename=False, iterator=None,
                 test=False, listener=None, total=None, root=None, seriesFirst=False):

        self.dirFormat = dirFormat
        self.fileFormat = fileFormat
        self.fileList = files
        self.anondict = anon
        self.keep_filename = keep_filename
        self.seriesFirst = seriesFirst
        self.outDir = outDir
        self.test = test
        self.iter = iterator
        self.root = root

        if not isinstance(self.fileList, tuple):
            self.fileList = (self.fileList,)

        if total is None:
            self.total = len(self.fileList)
        else:
            self.total = total

        self.isgui = False

        if listener:
            self.listener = listener
            self.isgui = True

        Thread.__init__(self)
        self.start()
Example #30
0
	def __init__(self, sync):
		Thread.__init__(self)
		self.sync = sync
		self.IPorts = []
		self.OPorts = []
		self.myOutput = {}
		self.myInput = {}
 def __init__(self, localhost, port=9999, data_ids={}):
     Thread.__init__(self)
     self.localhost = localhost
     self.port = port
     self.data_ids = data_ids
Example #32
0
 def __init__(self, queue):
     Thread.__init__(self)
     self.queue = queue
Example #33
0
 def __init__(self, ppa_path, keyserver=None):
     Thread.__init__(self)
     AddPPASigningKey.__init__(self, ppa_path=ppa_path, keyserver=keyserver)
Example #34
0
    def __init__(self, event, config_file, log=True, show=False):

        Thread.__init__(self)
        self.stopped = event

        ### Initialize controller variables ###
        config = ConfigParser.RawConfigParser()
        config.read(config_file)
        self.Td = config.getfloat('Controller', 'Td')
        self.__heli = Heli(config.getstring('Motors', 'port'))

        # Initialize motors
        self.__heli.set_12v_motor_sleep_state(False)
        self.__heli.set_5v_motor_sleep_state(False)

        # State variables
        (psi, theta, phi) = self.__heli.read_sensor_data()
        self.theta = [theta, theta]
        self.theta_ref = [0]
        self.phi = [phi, phi]
        self.phi_ref = [0]
        self.ref_idx = 0
        self.e_theta = [0, 0]
        self.e_phi = [0, 0]
        self.u_1 = [0, 0]
        self.u_2 = [0, 0]

        # Yaw controller parameters
        self.Kp2 = 1
        self.Ti2 = 1

        # Pitch fuzzy controller parameters

        # Input variables
        self.e_trimf = [[0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0],
                        [0.0, 0.0, 0.0], [0.0, 0.0, 0.0]]

        self.de_trimf = [[0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0],
                         [0.0, 0.0, 0.0], [0.0, 0.0, 0.0]]

        # Output singletons
        # Rows: de
        # Columns: e
        self.A = [[0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0],
                  [0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0],
                  [0.0, 0.0, 0.0, 0.0, 0.0]]

        # Proposition vectors
        self.mu_e_theta = [0 for i in range(len(self.e_trimf))]
        self.mu_e_phi = [0 for i in range(len(self.e_trimf))]
        self.mu_de_theta = [0 for i in range(len(self.de_trimf))]
        self.mu_de_phi = [0 for i in range(len(self.de_trimf))]
        self.antecedent_theta = [[0 for j in range(len(self.A))]
                                 for i in range(len(self.A))]
        self.antecedent_phi = [[0 for j in range(len(self.A))]
                               for i in range(len(self.A))]

        self.__log_on = log
        if self.__log_on:
            self.log = True
            now_str = datetime.now().__str__().split('.')[0]
            now_str = now_str.replace(' ', '-').replace(':', '-')
            self.logfile = open(now_str + '_ctrl_log.csv', 'wb')
            self.logger = csv.writer(self.logfile, delimiter=';')
Example #35
0
 def __init__(self, *args, **kwargs):
     Thread.__init__(self)
     NodeUpdater.__init__(self, *args, **kwargs)
     self.exitcode = -1
 def __init__(self, hash_queue):
     '''
     Constructor
     '''
     Thread.__init__(self)
     self.hash_queue = hash_queue
Example #37
0
 def __init__(self):
     Thread.__init__(self)
     self.lock = Lock()
     self.status = {'status': 'connecting', 'messages': []}
     self.input_dir = '/dev/input/by-id/'
     self.open_devices = []
     self.barcodes = Queue()
     self.keymap = {
         2: ("1", "!"),
         3: ("2", "@"),
         4: ("3", "#"),
         5: ("4", "$"),
         6: ("5", "%"),
         7: ("6", "^"),
         8: ("7", "&"),
         9: ("8", "*"),
         10: ("9", "("),
         11: ("0", ")"),
         12: ("-", "_"),
         13: ("=", "+"),
         # 14 BACKSPACE
         # 15 TAB
         16: ("q", "Q"),
         17: ("w", "W"),
         18: ("e", "E"),
         19: ("r", "R"),
         20: ("t", "T"),
         21: ("y", "Y"),
         22: ("u", "U"),
         23: ("i", "I"),
         24: ("o", "O"),
         25: ("p", "P"),
         26: ("[", "{"),
         27: ("]", "}"),
         # 28 ENTER
         # 29 LEFT_CTRL
         30: ("a", "A"),
         31: ("s", "S"),
         32: ("d", "D"),
         33: ("f", "F"),
         34: ("g", "G"),
         35: ("h", "H"),
         36: ("j", "J"),
         37: ("k", "K"),
         38: ("l", "L"),
         39: (";", ":"),
         40: ("'", "\""),
         41: ("`", "~"),
         # 42 LEFT SHIFT
         43: ("\\", "|"),
         44: ("z", "Z"),
         45: ("x", "X"),
         46: ("c", "C"),
         47: ("v", "V"),
         48: ("b", "B"),
         49: ("n", "N"),
         50: ("m", "M"),
         51: (",", "<"),
         52: (".", ">"),
         53: ("/", "?"),
         55: ("*", "*"),
         # 54 RIGHT SHIFT
         57: (" ", " "),
         71: ("7", "7"),
         72: ("8", "8"),
         73: ("9", "9"),
         75: ("4", "4"),
         76: ("5", "5"),
         77: ("6", "6"),
         79: ("1", "1"),
         80: ("2", "2"),
         81: ("3", "3"),
         82: ("0", "0"),
         # 96 enter
     }
 def __init__(self, task):
     Thread.__init__(self)
     self.task = task
     self.success = False
     self.done = False
     self.value = None
Example #39
0
 def __init__(self):
     Thread.__init__(self)
     self.stop = Event()
     self.messages = Queue()
     self.setDaemon(True)
Example #40
0
 def __init__(self, parent, sudo=False):
     self.parent = parent
     self.sudo = sudo
     Thread.__init__(self)
 def __init__(self, sid):
     Thread.__init__(self)
     self.sid = sid
Example #42
0
File: main.py Project: zaynb/odoo
 def __init__(self):
     Thread.__init__(self)
     self.queue = Queue()
     self.lock = Lock()
     self.status = {'status': 'connecting', 'messages': []}
Example #43
0
 def __init__(self, capture=False, captureMove=False):
     Thread.__init__(self)
     self.daemon = True
     self.capture = capture
     self.captureMove = captureMove
     self.state = True
Example #44
0
 def __init__(self):
     Thread.__init__(self)
     self.do_run = True
Example #45
0
 def __init__(self, _error=None, ):
     Thread.__init__(self)
     self._error = _error
Example #46
0
    def __init__(self, listen_port: int):
        Thread.__init__(self)

        self.exit_f = False
        self.listen_socket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
        self.setup_socket(listen_port)
Example #47
0
 def __init__(self, backend, cancelled, sleep_time):
     Thread.__init__(self)
     self.sleep_time = sleep_time
     self.backend = backend
     self.cancelled = cancelled
Example #48
0
 def __init__(self):
     Thread.__init__(self)
     self.active = True
Example #49
0
    def __init__(self,
                 f,
                 args,
                 stdin=None,
                 stdout=None,
                 stderr=None,
                 universal_newlines=False):
        """Parameters
        ----------
        f : function
            The function to be executed.
        args : list
            A (possibly empty) list containing the arguments that were given on
            the command line
        stdin : file-like, optional
            A file-like object representing stdin (input can be read from
            here).  If `stdin` is not provided or if it is explicitly set to
            `None`, then an instance of `io.StringIO` representing an empty
            file is used.
        stdout : file-like, optional
            A file-like object representing stdout (normal output can be
            written here).  If `stdout` is not provided or if it is explicitly
            set to `None`, then `sys.stdout` is used.
        stderr : file-like, optional
            A file-like object representing stderr (error output can be
            written here).  If `stderr` is not provided or if it is explicitly
            set to `None`, then `sys.stderr` is used.
        """
        self.f = f
        """
        The function to be executed.  It should be a function of four
        arguments, described below.

        Parameters
        ----------
        args : list
            A (possibly empty) list containing the arguments that were given on
            the command line
        stdin : file-like
            A file-like object representing stdin (input can be read from
            here).
        stdout : file-like
            A file-like object representing stdout (normal output can be
            written here).
        stderr : file-like
            A file-like object representing stderr (error output can be
            written here).
        """
        self.args = args
        self.pid = None
        self.returncode = None
        self.wait = self.join

        handles = self._get_handles(stdin, stdout, stderr)
        (self.p2cread, self.p2cwrite, self.c2pread, self.c2pwrite,
         self.errread, self.errwrite) = handles

        # default values
        self.stdin = stdin
        self.stdout = None
        self.stderr = None

        if ON_WINDOWS:
            if self.p2cwrite != -1:
                self.p2cwrite = msvcrt.open_osfhandle(self.p2cwrite.Detach(),
                                                      0)
            if self.c2pread != -1:
                self.c2pread = msvcrt.open_osfhandle(self.c2pread.Detach(), 0)
            if self.errread != -1:
                self.errread = msvcrt.open_osfhandle(self.errread.Detach(), 0)

        if self.p2cwrite != -1:
            self.stdin = io.open(self.p2cwrite, 'wb', -1)
            if universal_newlines:
                self.stdin = io.TextIOWrapper(self.stdin,
                                              write_through=True,
                                              line_buffering=False)
        if self.c2pread != -1:
            self.stdout = io.open(self.c2pread, 'rb', -1)
            if universal_newlines:
                self.stdout = io.TextIOWrapper(self.stdout)

        if self.errread != -1:
            self.stderr = io.open(self.errread, 'rb', -1)
            if universal_newlines:
                self.stderr = io.TextIOWrapper(self.stderr)

        Thread.__init__(self)
        self.start()
Example #50
0
 def __init__(self, name):
     Thread.__init__(self)
     self._socket = None
     self._name = name
Example #51
0
 def __init__(self, loop):
     Thread.__init__(self)
     self.rds = redis.StrictRedis(REDIS_HOST, 6379, db=1)
     self.loop_count = loop
Example #52
0
 def __init__(self, socket):
     Thread.__init__(self)
     self.socket = socket
Example #53
0
 def __init__(self, func):
     Thread.__init__(self)
     self.__action = func
     self.debug = False
Example #54
0
 def __init__(self):
     Thread.__init__(self)  #dichiarazione attributi del thread
     self.id = myId
     self.ip = ip
     self.url_conn = "http://" + ip + "/api/v1/receive"
Example #55
0
 def __init__(self, attrs):
     Thread.__init__(self)
     self.queue = Queue()
     self.timer = None
     self.loop = True
     self._attrs = attrs
Example #56
0
 def __init__(self, queue, selected_item_list, details):
     Thread.__init__(self)
     self.queue = queue
     self.selected_item_list = selected_item_list
     self.details = details
Example #57
0
 def __init__(self, database=DEFAULT_DB_ALIAS):
     self.database = database
     Thread.__init__(self)
     self.daemon = True
Example #58
0
 def __init__(self, tasks, logger):
     Thread.__init__(self)
     self.logger = logger
     self.tasks = tasks
     self.daemon = True
     self.start()
Example #59
0
 def start(self, target=None, args=()):
     if target:
         Thread.__init__(self, target=target, args=args)
     else:
         Thread.__init__(self, name="postgres")
     super(postgres, self).start()
Example #60
0
 def __init__(self):
     Thread.__init__(self)