projects
/
theonering
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Adding fancier version checks to allow to the cache to be preserved longer
[theonering]
/
src
/
gvoice
/
conversations.py
diff --git
a/src/gvoice/conversations.py
b/src/gvoice/conversations.py
index
f64c9f7
..
fed382b
100644
(file)
--- a/
src/gvoice/conversations.py
+++ b/
src/gvoice/conversations.py
@@
-36,15
+36,20
@@
class Conversations(object):
try:
with open(path, "rb") as f:
fileVersion, fileBuild, convs = pickle.load(f)
try:
with open(path, "rb") as f:
fileVersion, fileBuild, convs = pickle.load(f)
- except (pickle.PickleError, IOError):
+ except (pickle.PickleError, IOError, EOFError, ValueError):
_moduleLogger.exception("While loading for %s" % self._name)
return
_moduleLogger.exception("While loading for %s" % self._name)
return
- if fileVersion == constants.__version__ and fileBuild == constants.__build__:
+ if misc_utils.compare_versions(
+ misc_utils.parse_version("0.8.0"),
+ misc_utils.parse_version(fileVersion),
+ ) <= 0:
self._conversations = convs
else:
_moduleLogger.debug(
self._conversations = convs
else:
_moduleLogger.debug(
- "%s Skipping cache due to version mismatch (%s-%s)" % (self._name, fileVersion, fileBuild)
+ "%s Skipping cache due to version mismatch (%s-%s)" % (
+ self._name, fileVersion, fileBuild
+ )
)
def save(self, path):
)
def save(self, path):