How to use the eel.expose function in Eel

To help you get started, we’ve selected a few Eel examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ChrisKnott / Algojammer / sketch.py View on Github external
@eel.expose
def sketch_refresh(guid, geometry):
    proxy = proxies.get(guid)
    if proxy:
        proxy.io = mock.MockIO()
        proxy.canvas = drawing.Canvas(*geometry)
        try:
            if proxy.refresh_callback != None:
                proxy.refresh_callback()
            else:
                run_metacode(guid)      # No refresh callback defined - re-run all code
        except Exception as e:
            import traceback
            traceback.print_exc()
            print('-'*50)
            #pass;print('Exception sketch_refresh:', e)
github julesontheroad / NSC_BUILDER / py / ztools / lib / Interface.py View on Github external
@eel.expose	
def getfiledata(filename):
	print('* Generating Titles File Data')
	if filename.endswith('.nsp') or filename.endswith('.nsx') or filename.endswith('.nsz'):
		f = Fs.ChromeNsp(filename, 'rb')
	elif filename.endswith('.xci') or filename.endswith('.xcz'):	
		f = Fs.ChromeXci(filename)	
	else: return ""		
	feed=f.adv_file_list()
	f.flush()
	f.close()		
	return	feed
github ChrisKnott / Algojammer / gui.py View on Github external
@eel.expose
def key_down(guid, key):
    gui[key] = True
    for callback in callbacks[key].values():
        try:
            callback(guid, key, True)
        except:
            ...
github shadowmoose / RedditDownloader / redditdownloader / interfaces / eelwrapper.py View on Github external
@eel.expose
def api_get_sources():
	ret = {'available': [], 'active': [], 'filters': {}}
	for s in sources.load_sources():
		ret['available'].append(s.to_obj(for_webui=True))
	for s in settings.get_sources():
		ret['active'].append(s.to_obj(for_webui=True))
	ret['filters']['available'] = [f.to_js_obj() for f in filters.get_filters()]
	ret['filters']['operators'] = [f.value for f in filters.Operators]
	return ret
github julesontheroad / NSC_BUILDER / py / ztools / lib / Interface.py View on Github external
@eel.expose	
def getcnmtdata(filename):
	print('* Reading Data from Cnmt')
	if filename.endswith('.nsp')or filename.endswith('.nsx') or filename.endswith('.nsz'):
		f = Fs.ChromeNsp(filename, 'rb')
	elif filename.endswith('.xci') or filename.endswith('.xcz'):	
		f = Fs.ChromeXci(filename)	
	else: return ""			
	feed=f.read_cnmt()
	f.flush()
	f.close()			
	return	feed
github samuelhwilliams / Eel / examples / 04 - file_access / file_access.py View on Github external
@eel.expose
def pick_file(folder):
    if os.path.isdir(folder):
        return random.choice(os.listdir(folder))
    else:
        return 'Not valid folder'
github ChrisKnott / Algojammer / algojammer.py View on Github external
@eel.expose
def run(code, stdin=''):
    while state['mode'] != 'stopped':
        state['mode'] = 'interrupt'
        eel.sleep(0.01)

    state['mode'] = 'running'
    sta.execution_start()
    exe.bounded_exec(code, 10**7, report)
    state['mode'] = 'stopped'
github brentvollebregt / auto-py-to-exe / auto_py_to_exe / __main__.py View on Github external
@eel.expose
def check_if_file_exists(file):
    """ Checks if a file exists """
    return os.path.isfile(file)
github ChrisKnott / Algojammer / gui.py View on Github external
@eel.expose
def update_mouse_position(x, y):
    gui['mouse'] = (x, y)
github ChrisKnott / Algojammer / state.py View on Github external
@eel.expose
def get_all_variables():
    var_names = [str(s) for s in rec.get_all_variables()] # weird bugs here...
    return sorted(var_names)