def open(self):
		'''
		Build the base query object for this wrapper,
		then add all of the counters required for the query.
		Raise a QueryError if we can't complete the functions.
		If we are already open, then do nothing.
		'''
		if not self.active: # to prevent having multiple open queries
			# curpaths are made accessible here because of the possibility of volatile paths
			# which may be dynamically altered by subclasses.
			self.curpaths = copy.copy(self.paths)
			try:
				base = win32pdh.OpenQuery()
				for path in self.paths:
					try:
						self.counters.append(win32pdh.AddCounter(base, path))
					except win32api.error: # we passed a bad path
						self.counters.append(0)
						pass
				self._base = base
				self.active = 1
				return 0 # open succeeded
			except: # if we encounter any errors, kill the Query
				try:
					self.killbase(base)
				except __HOLE__: # failed in creating query
					pass
				self.active = 0
				self.curpaths = []
				raise QueryError(self)
		return 1 # already open
dataset/ETHPy150Open eBay/restcommander/play-1.2.4/python/Lib/site-packages/win32/lib/win32pdhquery.py/BaseQuery.open