예제 #1
0
파일: message.py 프로젝트: alienhard/notify
 def _load_project_and_story(self, source):
     """Try to extract and set the project and story IDs.
     
     AgileZen messages for comments do not have URLs...  :(
     In this case, resort to parsing project name and looking up its ID
     via the API.
     """
     match = re.search(PROJECT_STORY_RE, source)
     if match:
         self.project_id = int(match.group(1))
         self.story_id = int(match.group(2))
     else:
         match = re.search(ALT_PROJECT_STORY_RE, source, flags=re.DOTALL)
         if match:
             self.project_id = api.lookup_project_id(match.group(1))
             self.story_id = int(match.group(2))
         else:
             raise MessageCreationException(
                 'Could not parse project/story number from: ' + source)
예제 #2
0
파일: run.py 프로젝트: smros/pat
items = result['items']
print
print 'Items:'
for item in items: #Note:  This is actually a list of the projects.
    print item

# Look at project 0.
item = items[0]
print
print 'Items[0]:'
for key, val in item.iteritems():
    print key, val


# Lookup a non-archived project (case sensitive)
project_id = api.lookup_project_id('Test Project')
print
print 'Project:', project_id

# Get the stories for project.
print
print 'Stories:'
stories = api.list_stories(project_id)

storiesDict=dict()

for item in stories['items']:
    print 'raw:', item
    print 'id: ', item['id']
    print '  color:', item['color']
    print '  priority:', item['priority']