예제 #1
0
	def __init__(self, path=None, pid=None, url=None, desc=None, codecs= _defaultCodecs):
		"""
			path : str | None -- full path to local application
			pid : int | None -- Unix process id for local process
			url : str | None -- url for remote process
			desc : AEAddressDesc | None -- AEAddressDesc for application
			codecs : Codecs -- used to convert Python values to AEDescs and vice-versa
			
			Notes: 
				- If no path, pid, url or aedesc is given, target will be 'current application'.
				- If path is given, application will be launched automatically; if pid, url or desc is given, user is responsible for ensuring application is running before sending it any events.
		"""
		self._codecs = codecs
		self._path = path
		if path:
			self._address = connect.localapp(path)
			self.AEM_identity = ('path', path)
		elif pid:
			self._address = connect.localappbypid(pid)
			self.AEM_identity = ('pid', pid)
		elif url:
			self._address = connect.remoteapp(url)
			self.AEM_identity = ('url', url)
		elif desc:
			self._address = desc
			self.AEM_identity = ('desc', (desc.type, desc.data))
		else:
			self._address = connect.currentapp
			self.AEM_identity = ('current', None)
예제 #2
0
	def reconnect(self):
		"""If application has quit since this Application object was created, its AEAddressDesc is no longer valid so this Application object will not work even when application is restarted. reconnect() will update this Application object's AEAddressDesc so it's valid again.
		
		Note: this only works for Application objects specified by path, not by URL or AEDesc. Also, any Event objects created prior to calling reconnect() will still be invalid.
		"""
		if self._path:
			self._address = connect.localapp(self._path)
예제 #3
0
    def __init__(self, path=None, url=None, desc=None, codecs=_defaultCodecs):
        """
			path : string | None -- full path to local application
			url : string | None -- url for remote process
			desc : AEAddressDesc | None -- AEAddressDesc for application
			codecs : Codecs -- used to convert Python values to AEDescs and vice-versa
			
			Notes: 
				- If no path, url or aedesc is given, target will be 'current application'.
				- If path is given, application will be launched automatically; if url or desc is given, user is responsible for ensuring application is running before sending it events.
		"""
        self._codecs = codecs
        self._path = path
        if path:
            self._address = connect.localapp(path)
            self._identity = (path, 0, 0, 0)
        elif url:
            self._address = connect.remoteapp(url)
            self._identity = (0, url, 0, 0)
        elif desc:
            self._address = desc
            self._identity = (0, 0, desc.type, desc.data)
        else:
            self._address = connect.currentapp
예제 #4
0
	def __init__(self, path=None, url=None, desc=None, codecs= _defaultCodecs):
		"""
			path : string | None -- full path to local application
			url : string | None -- url for remote process
			desc : AEAddressDesc | None -- AEAddressDesc for application
			codecs : Codecs -- used to convert Python values to AEDescs and vice-versa
			
			Notes: 
				- If no path, url or aedesc is given, target will be 'current application'.
				- If path is given, application will be launched automatically; if url or desc is given, user is responsible for ensuring application is running before sending it events.
		"""
		self._codecs = codecs
		self._path = path
		if path:
			self._address = connect.localapp(path)
			self._identity = (path, 0, 0, 0)
		elif url:
			self._address = connect.remoteapp(url)
			self._identity = (0, url, 0, 0)
		elif desc:
			self._address = desc
			self._identity = (0, 0, desc.type, desc.data)
		else:
			self._address = connect.currentapp