7from .composite_filedirentry
import FileDirEntry, FileDirEntryList, FileEntry, DirEntry
8from datetime
import datetime
22 FileEntry(
"FileA.txt", 101, datetime.now()),
23 FileEntry(
"FileB.txt", 102, datetime.now()),
24 FileEntry(
"FileC.txt", 103, datetime.now()),
25 DirEntry(
"subdir1", datetime.now(), [ \
26 FileEntry(
"FileD.txt", 104, datetime.now()),
27 FileEntry(
"FileE.txt", 105, datetime.now()),
28 DirEntry(
"subdir2", datetime.now(), [ \
29 FileEntry(
"FileF.txt", 106, datetime.now()),
30 FileEntry(
"FileG.txt", 107, datetime.now())
46 root = Composite_FileAccess._rootEntry
49 pathComponents = filepath.split(
'/')
50 numComponents = len(pathComponents)
51 for index
in range(0, numComponents):
53 if root.Name != pathComponents[index]:
58 if index + 1 >= numComponents:
66 children = root.Children
74 childComponent = pathComponents[index + 1]
75 for child
in children:
76 if childComponent == child.Name:
99 filepath = filepath.replace(
'\\',
'/')
100 fileDirEntry = Composite_FileAccess._FindEntry(filepath)
102 raise FileNotFoundError(2,
"Unable to find entry", filepath)
Class containing static functions for accessing a hardcoded "file" and "directory" hierarchy.
FileDirEntry _FindEntry(str filepath)
Helper method to search the static data list for the specified file/dir entry.
FileDirEntry GetEntry(str filepath)
Retrieve a FileDirEntry object representing the specified file "path" in an internal list of data ent...
Represents a Directory entry.