Permalink
Browse files

Lighthouse.projects now emits a list of Project objects with all thei…

…r properties set
  • Loading branch information...
1 parent 6bf4f82 commit af5aab8f6a9cac184df25b1f10e95fa94b286df3 Clinton Ecker committed Feb 1, 2009
Showing with 9 additions and 1 deletion.
  1. +9 −1 lighthouse.py
View
@@ -91,7 +91,9 @@ def projects(self):
p_obj = Project()
for field in project['children']:
field_name, field_value, field_type = self._parse_field(field)
- print "%s: %s" % (field_name, field_value)
+ p_obj.__setattr__(field_name, field_value)
+ projects.append(p_obj)
+ return projects
class Ticket(object):
"""Tickets are individual issues or bugs"""
@@ -121,6 +123,12 @@ def __init__(self, archived=None, created_at=None,
self.open_states_list = open_states_list
self.closed_states_list = closed_states_list
self.open_tickets_count = open_tickets_count
+
+ def __repr__(self):
+ if self.name:
+ return "Project: %s" % (self.name,)
+ else:
+ return "Project: Unnamed"
class Milestone(object):
"""Milestones reference tickets"""

0 comments on commit af5aab8

Please sign in to comment.