81
83
##@brief Dictionary with all wrappers associated by their names.
83
85
__storageDictionary = {}
87
##@brief Dictionary with info of processes notifications such as (and
88
# just by now) percentage completed.
90
__notificationsInfo = {}
92
##@brief Lock to control acess of __notoificationsInfo dictionary
85
96
##@brief Default constructor.
96
107
# To get and set HD Lorean settings
97
108
self.__configFile = ConfigFileManager.ConfigFileManager()
98
109
self.__backupsPath = self.__configFile.getBackupDirectory()
111
# Set notificationInfo dictionary
112
self.__lockNI = threading.Lock()
113
#TODO: Inicializar DBUS para el envio de señales
102
117
##@brief Reload configfile manager settings.
131
146
self.__storageManager = XDelta3Wrapper.XDelta3Wrapper(self)
133
148
self.__storageDictionary[manager] = self.__storageManager
150
##@brief Lets a process to update (or create if it does not exist) its
153
#@param pid process id, key of the event
154
#@param percentage actual percentage of the process
155
#@param toSent by default is False. If its setted to True, a signal is sent
156
# to DBUS in order to notificate something to the frontend. Usefull for
158
def updateCompletationInfo(self, pid, percentage, toSent = False):
160
Lets a process to update (or create if it does not exist) its
163
self.__lockNI.acquire()
165
self.__notificationsInfo[pid] = percentage
167
pass # TODO: Send to DBUS
169
self.__lockNI.release()
171
##@brief Delete a completation log.
173
#@param pid process identifier key of the log
174
#@param toSent by default is False. If its setted to True, a signal is sent
175
# to DBUS in order to notificate something to the frontend. It happens just
176
# before delete the log. Usefull for progression bars.
177
def releaseCompletationInfo(self, pid, toSent = False):
178
self.__lockNI.acquire()
181
pass # TODO: Send to DBUS
182
if pid in self.__notificationsInfo:
183
del self.__notificationsInfo[pid]
185
self.__lockNI.release()
135
188
##@brief Gets a storage manager by its name.