This mixin contains code for managing the defect folders
Definition at line 17 of file folders.py.
◆ __init__()
None python.folders.DefectsDBFoldersMixin.__init__ |
( |
|
self | ) |
|
Definition at line 22 of file folders.py.
23 self._defects_folder =
None
24 self._defect_logic_folder =
None
25 self._parent_folderset =
None
26 self._connections = []
27 super(DefectsDBFoldersMixin, self).
__init__()
◆ _clear_connections()
None python.folders.DefectsDBFoldersMixin._clear_connections |
( |
|
self | ) |
|
|
private |
Definition at line 29 of file folders.py.
29 def _clear_connections(self) -> None:
30 log.debug(
"DefectsDB connections cleared")
31 for connection
in self._connections:
32 connection.closeDatabase()
33 self._connections = []
◆ _create_defect_logic_folder()
cool.IFolder python.folders.DefectsDBFoldersMixin._create_defect_logic_folder |
( |
|
self, |
|
|
cool.IDatabase |
db |
|
) |
| |
|
private |
Creates the COOL database/folder for virtual defect logic, if they don't exist.
Internal - use create=True in the constructor to create the COOL folder.
Definition at line 115 of file folders.py.
115 def _create_defect_logic_folder(self, db: cool.IDatabase) -> cool.IFolder:
117 Creates the COOL database/folder for virtual defect logic, if they don't exist.
118 Internal - use create=True in the constructor to create the COOL folder.
120 log.info(
"Creating defect logic folder")
122 record_spec = cool.RecordSpecification()
123 record_spec.extend(
"clauses", ST.String4k)
125 folder_spec = cool.FolderSpecification(FV.MULTI_VERSION, record_spec)
126 return db.createFolder(DEFECT_LOGIC_FOLDER, folder_spec,
127 DEFECT_LOGIC_FOLDER_DESC,
True)
◆ _create_defects_folder()
cool.IFolder python.folders.DefectsDBFoldersMixin._create_defects_folder |
( |
|
self, |
|
|
cool.IDatabase |
db |
|
) |
| |
|
private |
Creates the COOL database/folder for defects, if they don't exist.
Internal - use create=True in the constructor to create the COOL folder.
Definition at line 82 of file folders.py.
82 def _create_defects_folder(self, db: cool.IDatabase) -> cool.IFolder:
84 Creates the COOL database/folder for defects, if they don't exist.
85 Internal - use create=True in the constructor to create the COOL folder.
87 log.info(
"Creating defects folder")
89 record_spec = cool.RecordSpecification()
90 record_spec.extend(
"present", ST.Bool)
91 record_spec.extend(
"recoverable", ST.Bool)
92 record_spec.extend(
"user", ST.String255)
93 record_spec.extend(
"comment", ST.String255)
95 folder_spec = cool.FolderSpecification(FV.MULTI_VERSION, record_spec)
96 return db.createFolder(DEFECTS_FOLDER, folder_spec,
97 DEFECT_FOLDER_DESC,
True)
◆ _load_defect_logic_folder()
None python.folders.DefectsDBFoldersMixin._load_defect_logic_folder |
( |
|
self | ) |
|
|
private |
Internal function for populating the self._defect_logic_folder variable
Definition at line 107 of file folders.py.
107 def _load_defect_logic_folder(self) -> None:
109 Internal function for populating the self._defect_logic_folder variable
111 res = self._load_folder(DEFECT_LOGIC_FOLDER,
112 self._create_defect_logic_folder)
113 self._defect_logic_folder, self._defect_logic_payload = res
◆ _load_defects_folder()
None python.folders.DefectsDBFoldersMixin._load_defects_folder |
( |
|
self | ) |
|
|
private |
Internal function for populating the self._defects_folder variable
Definition at line 74 of file folders.py.
74 def _load_defects_folder(self) -> None:
76 Internal function for populating the self._defects_folder variable
78 log.debug(
"Loading defects folder")
79 res = self._load_folder(DEFECTS_FOLDER, self._create_defects_folder)
80 self._defects_folder, self._defect_payload = res
◆ _load_folder()
Tuple[cool.IFolder, cool.Record] python.folders.DefectsDBFoldersMixin._load_folder |
( |
|
self, |
|
|
|
folder, |
|
|
|
create_function |
|
) |
| |
|
private |
Internal function used to load a COOL folder
Definition at line 46 of file folders.py.
46 def _load_folder(self, folder, create_function) -> Tuple[cool.IFolder, cool.Record]:
48 Internal function used to load a COOL folder
50 db_folder_string =
"%s::%s" % (self.connection_string, folder)
53 create_function =
None
55 db, folder = Databases.get_folder(db_folder_string,
56 read_only=self._read_only,
57 create_function=create_function,
60 self._connections.
append(db)
62 payload = cool.Record(folder.payloadSpecification())
64 return folder, payload
◆ defect_logic_folder()
cool.IFolder python.folders.DefectsDBFoldersMixin.defect_logic_folder |
( |
|
self | ) |
|
Returns the folder containing the virtual defect logic, loading it if necessary
Definition at line 100 of file folders.py.
100 def defect_logic_folder(self) -> cool.IFolder:
102 Returns the folder containing the virtual defect logic, loading it if necessary
104 if self._defect_logic_folder
is None: self._load_defect_logic_folder()
105 return self._defect_logic_folder
◆ defects_folder()
cool.IFolder python.folders.DefectsDBFoldersMixin.defects_folder |
( |
|
self | ) |
|
Returns the folder containing the defects, loading it if necessary
Definition at line 67 of file folders.py.
67 def defects_folder(self) -> cool.IFolder:
69 Returns the folder containing the defects, loading it if necessary
71 if self._defects_folder
is None: self._load_defects_folder()
72 return self._defects_folder
◆ parent_folderset()
cool.IFolderSet python.folders.DefectsDBFoldersMixin.parent_folderset |
( |
|
self | ) |
|
Lazy-loads parent folderset (useful for heirarchical tag manipulation)
Definition at line 36 of file folders.py.
36 def parent_folderset(self) -> cool.IFolderSet:
38 Lazy-loads parent folderset (useful for heirarchical tag manipulation)
40 if self._parent_folderset
is None:
41 db = Databases.get_instance(self.connection_string,
42 read_only=self._read_only)
43 self._parent_folderset = db.getFolderSet(PARENT_FOLDERSET)
44 return self._parent_folderset
◆ _connections
python.folders.DefectsDBFoldersMixin._connections |
|
private |
◆ _defect_logic_folder
python.folders.DefectsDBFoldersMixin._defect_logic_folder |
|
private |
◆ _defect_logic_payload
python.folders.DefectsDBFoldersMixin._defect_logic_payload |
|
private |
◆ _defect_payload
python.folders.DefectsDBFoldersMixin._defect_payload |
|
private |
◆ _defects_folder
python.folders.DefectsDBFoldersMixin._defects_folder |
|
private |
◆ _parent_folderset
python.folders.DefectsDBFoldersMixin._parent_folderset |
|
private |
The documentation for this class was generated from the following file: