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 = aemconnect.localapp(path) self.AEM_identity = ('path', path) elif pid: self._address = aemconnect.localappbypid(pid) self.AEM_identity = ('pid', pid) elif url: self._address = aemconnect.remoteapp(url) self.AEM_identity = ('url', url) elif desc: self._address = desc self.AEM_identity = ('desc', (desc.type, desc.data)) else: self._address = aemconnect.currentapp self.AEM_identity = ('current', None)
def __init__(self, path=None, pid=None, url=None, desc=None, codecs=_defaultcodecs, newinstance=False, hide=False): """ 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 newinstance : bool -- launch a new application instance? hide : bool -- hide after launch? 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. - The newinstance and hide options only apply when specifying application by path. """ self._path, self._codecs, self._newinstance, self._hide = path, codecs, newinstance, hide if path: self._address = aemconnect.localapp(path, newinstance, hide) self.AEM_identity = ('path', path) elif pid: self._address = aemconnect.localappbypid(pid) self.AEM_identity = ('pid', pid) elif url: self._address = aemconnect.remoteapp(url) self.AEM_identity = ('url', url) elif desc: self._address = desc self.AEM_identity = ('desc', (desc.type, desc.data)) else: self._address = aemconnect.currentapp self.AEM_identity = ('current', None)
def __init__(self, path=None, pid=None, url=None, desc=None, codecs= _defaultcodecs, newinstance=False, hide=False): """ 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 newinstance : bool -- launch a new application instance? hide : bool -- hide after launch? 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. - The newinstance and hide options only apply when specifying application by path. """ self._path, self._codecs, self._newinstance, self._hide = path, codecs, newinstance, hide if path: self._address = aemconnect.localapp(path, newinstance, hide) self.AEM_identity = ('path', path) elif pid: self._address = aemconnect.localappbypid(pid) self.AEM_identity = ('pid', pid) elif url: self._address = aemconnect.remoteapp(url) self.AEM_identity = ('url', url) elif desc: self._address = desc self.AEM_identity = ('desc', (desc.type, desc.data)) else: self._address = aemconnect.currentapp self.AEM_identity = ('current', None)
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 = aemconnect.localapp(path) self.AEM_identity = ('path', path) elif pid: self._address = aemconnect.localappbypid(pid) self.AEM_identity = ('pid', pid) elif url: self._address = aemconnect.remoteapp(url) self.AEM_identity = ('url', url) elif desc: self._address = desc self.AEM_identity = ('desc', (desc.type, desc.data)) else: self._address = aemconnect.currentapp self.AEM_identity = ('current', None)