3 SCOPE_TRANSPONDERDATA = 0
17 SCOPE_TRANSPONDERDATA: ("/etc/", PATH_DONTCREATE),
18 SCOPE_SYSETC: ("/etc/", PATH_DONTCREATE),
19 SCOPE_FONTS: ("/usr/share/fonts/", PATH_DONTCREATE),
20 SCOPE_CONFIG: ("/etc/enigma2/", PATH_CREATE),
22 SCOPE_LANGUAGE: ("/usr/share/enigma2/po/", PATH_CREATE),
24 SCOPE_SKIN: ("/usr/share/enigma2/", PATH_DONTCREATE),
25 SCOPE_SKIN_IMAGE: ("/usr/share/enigma2/", PATH_DONTCREATE),
26 SCOPE_HDD: ("/hdd/movie/", PATH_DONTCREATE),
28 SCOPE_USERETC: ("", PATH_DONTCREATE) # user home directory
31 def resolveFilename(scope, base = ""):
32 # in future, we would check for file existence here,
33 # so we can provide default/fallbacks.
35 path = defaultPaths[scope]
36 if path[1] == PATH_CREATE:
37 if (not pathExists(scope)):
40 # FIXME: we also have to handle DATADIR etc. here.
43 # this is only the BASE - an extension must be added later.
45 def pathExists(scope):
46 return os.path.exists(defaultPaths[scope][0])
48 def getRecordingFilename(basename):
50 # filter out non-allowed characters
51 non_allowed_characters = "/.\\"
55 if c in non_allowed_characters:
61 path = resolveFilename(SCOPE_HDD, filename)
70 # this fixes paths or files when changed in a new enigma2 version
71 def fixOldDirectoryEntries():
72 if (os.path.exists("/hdd/movies")):
73 if (not os.path.exists(resolveFilename(SCOPE_HDD))):
74 os.system("mv /hdd/movies " + resolveFilename(SCOPE_HDD))