eric6/WebBrowser/FlashCookieManager/FlashCookieUtilities.py

changeset 8069
1176a936efa4
parent 8068
28457602b8f8
child 8070
6758ba4670e1
equal deleted inserted replaced
8068:28457602b8f8 8069:1176a936efa4
1 # -*- coding: utf-8 -*-
2
3 # Copyright (c) 2015 - 2021 Detlev Offenbach <detlev@die-offenbachs.de>
4 #
5
6 """
7 Module implementing some utility functions.
8 """
9
10 import os
11
12 from PyQt5.QtCore import QProcessEnvironment
13
14 import Globals
15
16
17 def flashDataPathForOS():
18 """
19 Function to determine the OS dependent path where Flash cookies
20 are stored.
21
22 @return Flash data path
23 @rtype str
24 """
25 # On Microsoft Windows NT 5.x and 6.x, they are stored in:
26 # %APPDATA%\Macromedia\Flash Player\#SharedObjects\
27 # %APPDATA%\Macromedia\Flash Player\macromedia.com\support\flashplayer\sys\
28 # On Mac OS X, they are stored in:
29 # ~/Library/Preferences/Macromedia/Flash Player/#SharedObjects/
30 # ~/Library/Preferences/Macromedia/Flash Player/macromedia.com/support/⏎
31 # flashplayer/sys/
32 # On Linux or Unix, they are stored in:
33 # ~/.macromedia/Flash_Player/#SharedObjects/
34 # ~/.macromedia/Flash_Player/macromedia.com/support/flashplayer/sys/
35 # For Linux and Unix systems, if the open-source Gnash plugin is being used
36 # instead of the official Adobe Flash, they will instead be found at:
37 # ~/.gnash/SharedObjects/
38
39 flashPath = ""
40
41 if Globals.isWindowsPlatform():
42 appData = QProcessEnvironment.systemEnvironment().value("APPDATA")
43 appData = appData.replace("\\", "/")
44 flashPath = appData + "/Macromedia/Flash Player"
45 elif Globals.isMacPlatform():
46 flashPath = os.path.expanduser(
47 "~/Library/Preferences/Macromedia/Flash Player")
48 else:
49 if os.path.exists(os.path.expanduser("~/.macromedia")):
50 flashPath = os.path.expanduser("~/.macromedia/Flash_Player")
51 elif os.path.exists(os.path.expanduser("~/.gnash")):
52 flashPath = os.path.expanduser("~/.gnash")
53
54 return flashPath
55
56 #
57 # eflag: noqa = M891

eric ide

mercurial