177 return self.location().toLocalFile() |
177 return self.location().toLocalFile() |
178 |
178 |
179 if self.__location.isEmpty(): |
179 if self.__location.isEmpty(): |
180 return "" |
180 return "" |
181 |
181 |
182 sha1 = QCryptographicHash.hash(self.__location, QCryptographicHash.Sha1).toHex() |
182 sha1 = bytes( |
|
183 QCryptographicHash.hash(self.__location, QCryptographicHash.Sha1).toHex())\ |
|
184 .decode() |
183 dataDir = os.path.join(Utilities.getConfigDir(), "browser", "subscriptions") |
185 dataDir = os.path.join(Utilities.getConfigDir(), "browser", "subscriptions") |
184 if not os.path.exists(dataDir): |
186 if not os.path.exists(dataDir): |
185 os.makedirs(dataDir) |
187 os.makedirs(dataDir) |
186 fileName = os.path.join(dataDir, "adblock_subscription_%s" % sha1) |
188 fileName = os.path.join(dataDir, "adblock_subscription_%s" % sha1) |
187 return fileName |
189 return fileName |