How to use the eel.browsers.set_path 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 julesontheroad / NSC_BUILDER / py / ztools / lib / Interface.py View on Github external
def start(browserpath='auto',videoplayback=True):
	global enablevideoplayback
	enablevideoplayback=videoplayback
	try:
		if browserpath == 'default':
			print("Launched using default system browser")
			eel.start('main.html', mode='default', size=(800, 720))				
		elif browserpath != 'auto' and os.path.exists(browserpath) and not browserpath.endswith('.ink'):
			eel.browsers.set_path('chrome', browserpath)
			About()
			print("Launched using: "+browserpath)
			eel.start('main.html', mode='chrome', size=(800, 720))
		elif browserpath != 'auto' and browserpath.endswith('.lnk') and sys.platform in ['win32', 'win64']:
			chrpath=os.path.join(ztools_dir,'chromium')
			chrpath_alt=os.path.join(squirrel_dir,'chromium')
			if not os.path.exists(browserpath) and os.path.exists(chrpath):
				browserpath=os.path.join(chrpath,browserpath)
			elif not os.path.exists(browserpath) and os.path.exists(chrpath_alt):
				browserpath=os.path.join(chrpath_alt,browserpath)
			elif not os.path.exists(browserpath):
				print(".lnk file doesn't exist")
				return False
			shell = win32com.client.Dispatch("WScript.Shell")
			browserpath = shell.CreateShortCut(browserpath)
			browserpath=browserpath.Targetpath
github julesontheroad / NSC_BUILDER / py / ztools / lib / Interface.py View on Github external
eel.browsers.set_path('chrome', browserpath)
			About()
			print("Launched using: "+browserpath)
			eel.start('main.html', mode='chrome', size=(800, 720))			
		elif os.path.exists(chromiumpath):
			eel.browsers.set_path('chrome', chromiumpath)
			About()
			print("Launched using: "+chromiumpath)
			eel.start('main.html', mode='chrome', size=(800, 720))		
		elif os.path.exists(chromiumpath_alt):	
			eel.browsers.set_path('chrome', chromiumpath_alt)
			About()
			print("Launched using: "+chromiumpath_alt)
			eel.start('main.html', mode='chrome', size=(800, 720))		
		elif os.path.exists(slimpath):
			eel.browsers.set_path('chrome', slimpath)
			About()
			print("Launched using: "+slimpath)
			eel.start('main.html', mode='chrome', size=(800, 720))		
		elif os.path.exists(slimpath_alt):	
			eel.browsers.set_path('chrome', slimpath_alt)
			About()
			print("Launched using: "+slimpath_alt)
			eel.start('main.html', mode='chrome', size=(800, 720))						
		else:
			try:
				About()
				print("Launched using Chrome Installation")
				eel.start('main.html', mode='chrome', size=(800, 720))
			except EnvironmentError:
				print("Chrome wasn't detected. Launched using Windows Edge with limited compatibility")	
				if sys.platform in ['win32', 'win64'] and int(platform.release()) >= 10:
github julesontheroad / NSC_BUILDER / py / ztools / lib / Interface.py View on Github external
eel.browsers.set_path('chrome', chromiumpath)
			About()
			print("Launched using: "+chromiumpath)
			eel.start('main.html', mode='chrome', size=(800, 720))		
		elif os.path.exists(chromiumpath_alt):	
			eel.browsers.set_path('chrome', chromiumpath_alt)
			About()
			print("Launched using: "+chromiumpath_alt)
			eel.start('main.html', mode='chrome', size=(800, 720))		
		elif os.path.exists(slimpath):
			eel.browsers.set_path('chrome', slimpath)
			About()
			print("Launched using: "+slimpath)
			eel.start('main.html', mode='chrome', size=(800, 720))		
		elif os.path.exists(slimpath_alt):	
			eel.browsers.set_path('chrome', slimpath_alt)
			About()
			print("Launched using: "+slimpath_alt)
			eel.start('main.html', mode='chrome', size=(800, 720))						
		else:
			try:
				About()
				print("Launched using Chrome Installation")
				eel.start('main.html', mode='chrome', size=(800, 720))
			except EnvironmentError:
				print("Chrome wasn't detected. Launched using Windows Edge with limited compatibility")	
				if sys.platform in ['win32', 'win64'] and int(platform.release()) >= 10:
					# print(platform.release())
					eel.start('main.html', mode='edge', size=(800, 720))
				else:
					raise				
	except (SystemExit, MemoryError, KeyboardInterrupt):
github julesontheroad / NSC_BUILDER / py / ztools / lib / Interface.py View on Github external
if not os.path.exists(browserpath) and os.path.exists(chrpath):
				browserpath=os.path.join(chrpath,browserpath)
			elif not os.path.exists(browserpath) and os.path.exists(chrpath_alt):
				browserpath=os.path.join(chrpath_alt,browserpath)
			elif not os.path.exists(browserpath):
				print(".lnk file doesn't exist")
				return False
			shell = win32com.client.Dispatch("WScript.Shell")
			browserpath = shell.CreateShortCut(browserpath)
			browserpath=browserpath.Targetpath	
			eel.browsers.set_path('chrome', browserpath)
			About()
			print("Launched using: "+browserpath)
			eel.start('main.html', mode='chrome', size=(800, 720))			
		elif os.path.exists(chromiumpath):
			eel.browsers.set_path('chrome', chromiumpath)
			About()
			print("Launched using: "+chromiumpath)
			eel.start('main.html', mode='chrome', size=(800, 720))		
		elif os.path.exists(chromiumpath_alt):	
			eel.browsers.set_path('chrome', chromiumpath_alt)
			About()
			print("Launched using: "+chromiumpath_alt)
			eel.start('main.html', mode='chrome', size=(800, 720))		
		elif os.path.exists(slimpath):
			eel.browsers.set_path('chrome', slimpath)
			About()
			print("Launched using: "+slimpath)
			eel.start('main.html', mode='chrome', size=(800, 720))		
		elif os.path.exists(slimpath_alt):	
			eel.browsers.set_path('chrome', slimpath_alt)
			About()
github julesontheroad / NSC_BUILDER / py / ztools / lib / Interface.py View on Github external
print("Launched using: "+browserpath)
			eel.start('main.html', mode='chrome', size=(800, 720))
		elif browserpath != 'auto' and browserpath.endswith('.lnk') and sys.platform in ['win32', 'win64']:
			chrpath=os.path.join(ztools_dir,'chromium')
			chrpath_alt=os.path.join(squirrel_dir,'chromium')
			if not os.path.exists(browserpath) and os.path.exists(chrpath):
				browserpath=os.path.join(chrpath,browserpath)
			elif not os.path.exists(browserpath) and os.path.exists(chrpath_alt):
				browserpath=os.path.join(chrpath_alt,browserpath)
			elif not os.path.exists(browserpath):
				print(".lnk file doesn't exist")
				return False
			shell = win32com.client.Dispatch("WScript.Shell")
			browserpath = shell.CreateShortCut(browserpath)
			browserpath=browserpath.Targetpath	
			eel.browsers.set_path('chrome', browserpath)
			About()
			print("Launched using: "+browserpath)
			eel.start('main.html', mode='chrome', size=(800, 720))			
		elif os.path.exists(chromiumpath):
			eel.browsers.set_path('chrome', chromiumpath)
			About()
			print("Launched using: "+chromiumpath)
			eel.start('main.html', mode='chrome', size=(800, 720))		
		elif os.path.exists(chromiumpath_alt):	
			eel.browsers.set_path('chrome', chromiumpath_alt)
			About()
			print("Launched using: "+chromiumpath_alt)
			eel.start('main.html', mode='chrome', size=(800, 720))		
		elif os.path.exists(slimpath):
			eel.browsers.set_path('chrome', slimpath)
			About()