Yes, the Eventghost plugin should also be visible in the list of connected devices.
As you describe it, something is wrong in the version for 0.5.0.
Pako
Yes, the Eventghost plugin should also be visible in the list of connected devices.
I do not know what's going on on your side, but everything works for me as expected.
Code: Select all
import eg
import os
os.environ['REQUESTS_CA_BUNDLE'] = os.path.join(
eg.sitePackagesDir,
'requests',
'cacert.pem'
)
Code: Select all
import pycurl
import certifi
curl = pycurl.Curl()
curl.setopt(pycurl.CAINFO, certifi.where())
Code: Select all
import pycurl
import os
curl = pycurl.Curl()
curl.setopt(pycurl.CAINFO, os.path.join(eg.sitePackagesDir, 'requests', 'cacert.pem'))
Code: Select all
import eg
import sys
def _excepthook(tpe, value, tb=None):
lines = traceback.format_exception(tpe, value, tb)
for i, line in enumerate(lines[:]):
if "self.__dict__['_curl']" in line:
lines.pop(i)
lines.pop(i - 1)
for line in lines:
sys.stderr.write(line)
eg.globals._traceback_buffer = []
def print_error(*args, **kwargs):
args = list(args)
msg = args[0]
if 'Traceback' in msg:
if eg.globals._traceback_buffer:
for line in eg.globals._traceback_buffer:
eg.globals._print_error(line)
eg.globals._traceback_buffer = []
eg.globals._traceback_buffer += [msg]
elif eg.globals._traceback_buffer:
if "self.__dict__['_curl']" in msg:
eg.globals._traceback_buffer = eg.globals._traceback_buffer[:-1]
else:
eg.globals._traceback_buffer += [msg]
if 'Error:' in msg:
for line in eg.globals._traceback_buffer:
eg.globals._print_error(line)
eg.globals._traceback_buffer = []
if hasattr(eg.globals, '_old_excepthook'):
sys.excepthook = eg.globals._old_excepthook
if hasattr(eg.globals, '_print_error'):
eg.__dict__['PrintError'] = eg.globals._print_error
eg.globals._print_error = eg.__dict__['PrintError']
eg.__dict__['PrintError'] = print_error
eg.globals._old_excepthook = sys.excepthook
sys.excepthook = _excepthook
import os
import traceback
for mod_name in sys.modules.keys():
if mod_name.startswith('pycurl'):
try:
del sys.modules[mod_name]
except KeyError:
pass
import pycurl
_curl = pycurl.Curl
class PyCurlWrapper(object):
def __init__(self, *args, **kwargs):
self.__dict__['_curl'] = _curl(*args, **kwargs)
self.__dict__['_curl'].setopt(pycurl.CAINFO, os.path.join(eg.sitePackagesDir, 'requests', 'cacert.pem'))
def __getattr__(self, item):
return getattr(self.__dict__['_curl'], item)
def __setattr__(self, key, value):
setattr(self.__dict__['_curl'], key, value)
def __getitem__(self, item):
return self.__dict__['_curl'][item]
def __setitem__(self, key, value):
self.__dict__['_curl'][key] = value
def __del__(self):
del(self.__dict__['_curl'])
def reset():
self.__dict__['_curl'].reset()
self.__dict__['_curl'].setopt(pycurl.CAINFO, os.path.join(eg.sitePackagesDir, 'requests', 'cacert.pem'))
def __repr__(self):
return str(self.__dict__['_curl'])
def __str__(self):
return str(self.__dict__['_curl'])
def __unicode__(self):
return unicode(str(self))
sys.modules['pycurl'].Curl = PyCurlWrapper