def __init__(self, keepalive_interval=5, keepalive_count=5): self.keepalive_interval = keepalive_interval self.keepalive_count = keepalive_count # connection dict # maps hostnames to a list of connection objects for this hostname # atm it is possible to create more than one connection per hostname # with different logins or auth methods # connections are shared between all threads, see: # http://wiki.libvirt.org/page/FAQ#Is_libvirt_thread_safe.3F self._connections = dict() self._connections_lock = ReadWriteLock() # start event loop to handle keepalive requests and other events self._event_loop = wvmEventLoop() self._event_loop.start()
def __init__(self, parent=None): QtGui.QWidget.__init__(self, parent) self.ui = Ui_Dialog() # Ui_Dialog为.ui产生.py文件中窗体类名 self.ui.setupUi(self) self.ui.input.clicked.connect(self.input) self.ui.output.clicked.connect(self.output) self.ui.clear.clicked.connect(self.clear) self.ui.start.clicked.connect(self.start) self.ui.stop.clicked.connect(self.stop) self.queue = Queue.Queue() self.ip_lock = ReadWriteLock() self.dirty = False self.pid = None self.address = self.ui.address.text().__str__() self.username = self.ui.username.text().__str__() self.password = self.ui.password.text().__str__() threading.Thread(target=self.change_ip).start() for i in range(1): threading.Thread(target=self.login_thread).start()
import uprclindex from uprclhttp import runbottle import minimconfig from upmplgutils import uplog from uprclutils import findmyip from conftree import stringToStrings # Once initialization (not on imports) try: _s = g_httphp except: # The recoll documents g_pathprefix = "" g_httphp = "" g_dblock = ReadWriteLock() g_rclconfdir = "" g_friendlyname = "UpMpd-mediaserver" g_trees = {} g_trees_order = ['folders', 'playlists', 'tags', 'untagged'] g_minimconfig = None def _reset_index(): _update_index(True) # Create or update Recoll index, then read and process the data. This # runs in the separate uprcl_init_worker thread, and signals # startup/completion by setting/unsetting the g_initrunning flag def _update_index(rebuild=False):