1 # Copyright 2014 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
7 _next_user_story_id = 0
10 class UserStory(object):
11 def __init__(self, name=''):
13 global _next_user_story_id
14 self._id = _next_user_story_id
15 _next_user_story_id += 1
26 """Converts a user story object to a dict suitable for JSON output."""
31 d['name'] = self._name
35 def file_safe_name(self):
36 """A version of display_name that's safe to use as a filename."""
37 # Just replace all special characters in the url with underscore.
38 return re.sub('[^a-zA-Z0-9]', '_', self.display_name)
41 def display_name(self):
45 return self.__class__.__name__