Changeset 1097:f2ac841cffec for src/mlx/gui/cef.py
- Timestamp:
- 08/11/23 14:39:35 (9 months ago)
- Branch:
- python3
- hg-Phase:
- (<MercurialRepository 1 'hg:/home/ivaradi/mlx/hg' '/'>, 'public')
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/mlx/gui/cef.py
r1096 r1097 34 34 # The SimBrief handler 35 35 _simBriefHandler = None 36 37 # The cache directory 38 cacheDir = os.path.join(GLib.get_user_cache_dir(), "mlxcef") 36 39 37 40 #------------------------------------------------------------------------------ … … 222 225 print("Initializing CEF with args:", args) 223 226 224 cacheDir = os.path.join(GLib.get_user_cache_dir(), "mlxcef")225 226 try:227 shutil.rmtree(cacheDir)228 print("gui.cef._initializeCEF1: the cache directory is removed")229 except Exception as e:230 print("gui.cef._initializeCEF1: cache directory removal failed:", e)231 232 227 settings = { 233 228 "debug": True, # cefpython debug messages in console and in log_file … … 241 236 (cefpython.GetModuleDirectory(), "subprocess"), 242 237 "windowless_rendering_enabled": True, 243 "cache_path": cacheDir 238 "cache_path": cacheDir, 239 "persist_session_cookies": True, 240 "persist_user_preferences": True 244 241 } 245 242 … … 378 375 #------------------------------------------------------------------------------ 379 376 377 def finalizeSimBrief(): 378 """Finallize the (hidden) browser window for SimBrief.""" 379 if _simBriefHandler is not None: 380 _simBriefHandler.finalize() 381 382 #------------------------------------------------------------------------------ 383 380 384 def finalize(): 381 385 """Finalize the Chrome Embedded Framework.""" … … 383 387 _toQuit = True 384 388 385 _simBriefHandler.finalize() 386 387 cefpython.Shutdown() 389 if os.name!="nt": 390 cefpython.Shutdown() 391 392 #------------------------------------------------------------------------------ 393 394 def clearCache(): 395 """Clear the CEF cache directory.""" 396 try: 397 shutil.rmtree(cacheDir) 398 print("gui.cef.clearCache: the cache directory is removed") 399 except Exception as e: 400 print("gui.cef.clearCache: cache directory removal failed:", e) 388 401 389 402 #------------------------------------------------------------------------------
Note:
See TracChangeset
for help on using the changeset viewer.