Changeset 1096:3b923185a50d for src/mlx


Ignore:
Timestamp:
07/16/23 10:58:19 (16 months ago)
Author:
István Váradi <ivaradi@…>
Branch:
python3
Phase:
public
Message:

The CEF cache directory is removed on startup

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/mlx/gui/cef.py

    r1095 r1096  
    1919from io import StringIO
    2020import lxml.html
     21import shutil
    2122
    2223#------------------------------------------------------------------------------
     
    221222    print("Initializing CEF with args:", args)
    222223
     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
    223232    settings = {
    224233        "debug": True, # cefpython debug messages in console and in log_file
     
    232241            (cefpython.GetModuleDirectory(), "subprocess"),
    233242        "windowless_rendering_enabled": True,
    234         "cache_path": os.path.join(GLib.get_user_cache_dir(),
    235                                    "mlxcef")
     243        "cache_path": cacheDir
    236244    }
    237245
Note: See TracChangeset for help on using the changeset viewer.