Helpviewer/AdBlock/AdBlockSubscription.py

changeset 134
c2dd2bf92ece
parent 42
23b45a742e17
child 168
3383117f894b
equal deleted inserted replaced
133:5b6e8eb22796 134:c2dd2bf92ece
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

eric ide

mercurial