region_pointlists,route_pointlists,continent_colors,line_colors = \
self._get_data(name)
regions = self._generate_regions(region_pointlists, route_pointlists)
- return Template('template', regions, continent_colors, line_colors)
+ return Template(name, regions, continent_colors, line_colors)
def _get_data(self, name):
dirname = os.path.join(self.template_dir, name.lower())
try:
% (float(width)/self.dpcm, float(height)/self.dpcm,
width, height),
' xmlns="http://www.w3.org/2000/svg" version="1.1">',
- '<desc>PyRisk world: %s</desc>' % template,
- ]
+ '<title>%s</title>' % template,
+ '<desc>A PyRisk world snapshot</desc>',
+ ]
drawn_rts = {}
for r in template.regions:
t = self._matching_territory(world, r)
b_col_attr = 'stroke="%s" stroke-width="%d"' \
% (template.line_colors['border'], self.line_width)
lines.extend([
- '<!-- %s -->' % r,
- '<polygon fill="%s" %s' % (c_col, b_col_attr),
+ '<polygon title="%s / %s / %s"'
+ % (t, t.player, t.armies),
+ ' fill="%s" %s' % (c_col, b_col_attr),
' points="%s" />'
% ' '.join(['%d,%d' % ((region_pos[id(r)]+p)
*(1,-1) # svg y value increases down