changeset 4:84344f9ed3f8

handle startup case
author Jeff Hammel <jhammel@mozilla.com>
date Tue, 28 Dec 2010 16:59:58 -0800
parents fc09a7ffb767
children 65acb32e8dc3
files svgsitemap/middleware.py
diffstat 1 files changed, 1 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/svgsitemap/middleware.py
+++ b/svgsitemap/middleware.py
@@ -144,16 +144,17 @@ class SVGSiteMap(object):
             count += 1
             if count > self.max:
                 self.max = count
             self.edges[(from_url, to_url)] = count
             edge = self.graph.get_edge(from_url, to_url)
             edge.attr['label'] =  str(count)
         else:
             self.edges[(from_url, to_url)] = 1
+            self.max = 1
             self.graph.add_edge(from_url, to_url, label='1')
 
         for edge in self.graph.edges():
             count = self.edges[(edge[0], edge[1])]
             width = self.maxwidth * count / self.max
             if not width:
                 width = self.minwidth
             edge.attr['style'] = 'setlinewidth(%s)' % width