From dacad103e6f02f1953c6d5a9837e347793d1c52a Mon Sep 17 00:00:00 2001 From: Gordan Grasarevic Date: Fri, 21 Feb 2014 21:55:40 +0000 Subject: [PATCH] Fix cache folder issue. --- gutter_color.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gutter_color.py b/gutter_color.py index 8596151..6f7e982 100644 --- a/gutter_color.py +++ b/gutter_color.py @@ -18,10 +18,10 @@ def plugin_loaded(): # The maximum amount of space to take up limit = 5242880 # 5 MB - # Get the size of the cache folder - size = sum(getsize(join(icon_path, f)) for f in listdir(icon_path) if isfile(join(icon_path, f))) + if exists(icon_path): + size = sum(getsize(join(icon_path, f)) for f in listdir(icon_path) if isfile(join(icon_path, f))) + if size > limit: rmtree(icon_path) - if size > limit: rmtree(icon_path) if not exists(icon_path): makedirs(icon_path) class GutterColorEventListener(EventListener):