Re: python API: target_people access fails

2013-03-26 Thread Steven MacLeod
Hi,

This is an issue with Python versions < 2.6.5. I have a fix for it which
will be part of the RBTools 0.5.1 release which is coming soon.


On Fri, Mar 22, 2013 at 6:13 PM, Steven MacLeod  wrote:

> What version of python are you running?
>
>
> On Fri, Mar 22, 2013 at 3:54 PM, A.M. wrote:
>
>> On Fri, 22 Mar 2013 15:25:48 -0400, Steven MacLeod 
>> wrote:
>> > That looks correct. I'm not quire sure what's going wrong.
>> >
>> > Could you provide me with the JSON payload being used to create the
>> review
>> > request resource. You can get this by running:
>> >
>> >
>> > review_requests = rb_conn.get_root().get_review_
>> > requests(time_added_from=time_added, status='pending', max_results=1)
>> >
>> > for rr in review_requests:
>> > print rr._resource._payload
>>
>> Sure- here is one sanitized parsed-to-dict JSON structure:
>>
>> {u'status': u'pending', u'last_updated': u'2013-03-22T18:39:57.056Z',
>> u'description': u"_", u'links': {u'diffs': {u'href':
>> u'https://reviewboard._.com/api/review-requests/2727/diffs/', u'method':
>> u'GET'}, u'repository': {u'href':
>> u'https://reviewboard._.com/api/repositories/9/', u'method': u'GET',
>> u'title': u'_'}, u'changes': {u'href':
>> u'https://reviewboard._.com/api/review-requests/2727/changes/',
>> u'method':
>> u'GET'}, u'self': {u'href':
>> u'https://reviewboard._.com/api/review-requests/2727/', u'method':
>> u'GET'},
>> u'update': {u'href':
>> u'https://reviewboard._.com/api/review-requests/2727/', u'method':
>> u'PUT'},
>> u'last_update': {u'href':
>> u'https://reviewboard._.com/api/review-requests/2727/last-update/',
>> u'method': u'GET'}, u'reviews': {u'href':
>> u'https://reviewboard._.com/api/review-requests/2727/reviews/',
>> u'method':
>> u'GET'}, u'draft': {u'href':
>> u'https://reviewboard._.com/api/review-requests/2727/draft/', u'method':
>> u'GET'}, u'file_attachments': {u'href':
>> u'https://reviewboard._.com/api/review-requests/2727/file-attachments/',
>> u'method': u'GET'}, u'submitter': {u'href':
>> u'https://reviewboard._.com/api/users/_/', u'method': u'GET', u'title':
>> u'_'}, u'screenshots': {u'href':
>> u'https://reviewboard._.com/api/review-requests/2727/screenshots/',
>> u'method': u'GET'}, u'delete': {u'href':
>> u'https://reviewboard._.com/api/review-requests/2727/', u'method':
>> u'DELETE'}}, u'target_groups': [], u'bugs_closed': [u'_'], u'changenum':
>> None, u'target_people': [{u'href':
>> u'https://reviewboard._.com/api/users/_/', u'method': u'GET', u'title':
>> u'_'}, {u'href': u'https://reviewboard._.com/api/users/_/', u'method':
>> u'GET', u'title': u'_'}, {u'href':
>> u'https://reviewboard._.com/api/users/_/', u'method': u'GET', u'title':
>> u'_'}], u'testing_done': u"_", u'branch': u'2013-1', u'id': 2727,
>> u'time_added': u'2013-03-22T16:49:32.368Z', u'summary': u'_', u'public':
>> True}
>>
>> Company-specific information has been redacted with underscores.
>>
>> We are using ReviewBoard 1.7.5, in case that matters.
>>
>> Cheers,
>> M
>>
>> --
>> Want to help the Review Board project? Donate today at
>> http://www.reviewboard.org/donate/
>> Happy user? Let us know at http://www.reviewboard.org/users/
>> -~--~~~~--~~--~--~---
>> To unsubscribe from this group, send email to
>> reviewboard+unsubscr...@googlegroups.com
>> For more options, visit this group at
>> http://groups.google.com/group/reviewboard?hl=en
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "reviewboard" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to reviewboard+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>>
>>
>

-- 
Want to help the Review Board project? Donate today at 
http://www.reviewboard.org/donate/
Happy user? Let us know at http://www.reviewboard.org/users/
-~--~~~~--~~--~--~---
To unsubscribe from this group, send email to 
reviewboard+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/reviewboard?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"reviewboard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to reviewboard+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: python API: target_people access fails

2013-03-22 Thread Steven MacLeod
What version of python are you running?


On Fri, Mar 22, 2013 at 3:54 PM, A.M.  wrote:

> On Fri, 22 Mar 2013 15:25:48 -0400, Steven MacLeod 
> wrote:
> > That looks correct. I'm not quire sure what's going wrong.
> >
> > Could you provide me with the JSON payload being used to create the
> review
> > request resource. You can get this by running:
> >
> >
> > review_requests = rb_conn.get_root().get_review_
> > requests(time_added_from=time_added, status='pending', max_results=1)
> >
> > for rr in review_requests:
> > print rr._resource._payload
>
> Sure- here is one sanitized parsed-to-dict JSON structure:
>
> {u'status': u'pending', u'last_updated': u'2013-03-22T18:39:57.056Z',
> u'description': u"_", u'links': {u'diffs': {u'href':
> u'https://reviewboard._.com/api/review-requests/2727/diffs/', u'method':
> u'GET'}, u'repository': {u'href':
> u'https://reviewboard._.com/api/repositories/9/', u'method': u'GET',
> u'title': u'_'}, u'changes': {u'href':
> u'https://reviewboard._.com/api/review-requests/2727/changes/', u'method':
> u'GET'}, u'self': {u'href':
> u'https://reviewboard._.com/api/review-requests/2727/', u'method':
> u'GET'},
> u'update': {u'href':
> u'https://reviewboard._.com/api/review-requests/2727/', u'method':
> u'PUT'},
> u'last_update': {u'href':
> u'https://reviewboard._.com/api/review-requests/2727/last-update/',
> u'method': u'GET'}, u'reviews': {u'href':
> u'https://reviewboard._.com/api/review-requests/2727/reviews/', u'method':
> u'GET'}, u'draft': {u'href':
> u'https://reviewboard._.com/api/review-requests/2727/draft/', u'method':
> u'GET'}, u'file_attachments': {u'href':
> u'https://reviewboard._.com/api/review-requests/2727/file-attachments/',
> u'method': u'GET'}, u'submitter': {u'href':
> u'https://reviewboard._.com/api/users/_/', u'method': u'GET', u'title':
> u'_'}, u'screenshots': {u'href':
> u'https://reviewboard._.com/api/review-requests/2727/screenshots/',
> u'method': u'GET'}, u'delete': {u'href':
> u'https://reviewboard._.com/api/review-requests/2727/', u'method':
> u'DELETE'}}, u'target_groups': [], u'bugs_closed': [u'_'], u'changenum':
> None, u'target_people': [{u'href':
> u'https://reviewboard._.com/api/users/_/', u'method': u'GET', u'title':
> u'_'}, {u'href': u'https://reviewboard._.com/api/users/_/', u'method':
> u'GET', u'title': u'_'}, {u'href':
> u'https://reviewboard._.com/api/users/_/', u'method': u'GET', u'title':
> u'_'}], u'testing_done': u"_", u'branch': u'2013-1', u'id': 2727,
> u'time_added': u'2013-03-22T16:49:32.368Z', u'summary': u'_', u'public':
> True}
>
> Company-specific information has been redacted with underscores.
>
> We are using ReviewBoard 1.7.5, in case that matters.
>
> Cheers,
> M
>
> --
> Want to help the Review Board project? Donate today at
> http://www.reviewboard.org/donate/
> Happy user? Let us know at http://www.reviewboard.org/users/
> -~--~~~~--~~--~--~---
> To unsubscribe from this group, send email to
> reviewboard+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/reviewboard?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "reviewboard" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to reviewboard+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
Want to help the Review Board project? Donate today at 
http://www.reviewboard.org/donate/
Happy user? Let us know at http://www.reviewboard.org/users/
-~--~~~~--~~--~--~---
To unsubscribe from this group, send email to 
reviewboard+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/reviewboard?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"reviewboard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to reviewboard+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: python API: target_people access fails

2013-03-22 Thread A.M.
On Fri, 22 Mar 2013 15:25:48 -0400, Steven MacLeod 
wrote:
> That looks correct. I'm not quire sure what's going wrong.
> 
> Could you provide me with the JSON payload being used to create the
review
> request resource. You can get this by running:
> 
> 
> review_requests = rb_conn.get_root().get_review_
> requests(time_added_from=time_added, status='pending', max_results=1)
> 
> for rr in review_requests:
> print rr._resource._payload

Sure- here is one sanitized parsed-to-dict JSON structure:

{u'status': u'pending', u'last_updated': u'2013-03-22T18:39:57.056Z',
u'description': u"_", u'links': {u'diffs': {u'href':
u'https://reviewboard._.com/api/review-requests/2727/diffs/', u'method':
u'GET'}, u'repository': {u'href':
u'https://reviewboard._.com/api/repositories/9/', u'method': u'GET',
u'title': u'_'}, u'changes': {u'href':
u'https://reviewboard._.com/api/review-requests/2727/changes/', u'method':
u'GET'}, u'self': {u'href':
u'https://reviewboard._.com/api/review-requests/2727/', u'method': u'GET'},
u'update': {u'href':
u'https://reviewboard._.com/api/review-requests/2727/', u'method': u'PUT'},
u'last_update': {u'href':
u'https://reviewboard._.com/api/review-requests/2727/last-update/',
u'method': u'GET'}, u'reviews': {u'href':
u'https://reviewboard._.com/api/review-requests/2727/reviews/', u'method':
u'GET'}, u'draft': {u'href':
u'https://reviewboard._.com/api/review-requests/2727/draft/', u'method':
u'GET'}, u'file_attachments': {u'href':
u'https://reviewboard._.com/api/review-requests/2727/file-attachments/',
u'method': u'GET'}, u'submitter': {u'href':
u'https://reviewboard._.com/api/users/_/', u'method': u'GET', u'title':
u'_'}, u'screenshots': {u'href':
u'https://reviewboard._.com/api/review-requests/2727/screenshots/',
u'method': u'GET'}, u'delete': {u'href':
u'https://reviewboard._.com/api/review-requests/2727/', u'method':
u'DELETE'}}, u'target_groups': [], u'bugs_closed': [u'_'], u'changenum':
None, u'target_people': [{u'href':
u'https://reviewboard._.com/api/users/_/', u'method': u'GET', u'title':
u'_'}, {u'href': u'https://reviewboard._.com/api/users/_/', u'method':
u'GET', u'title': u'_'}, {u'href':
u'https://reviewboard._.com/api/users/_/', u'method': u'GET', u'title':
u'_'}], u'testing_done': u"_", u'branch': u'2013-1', u'id': 2727,
u'time_added': u'2013-03-22T16:49:32.368Z', u'summary': u'_', u'public':
True}

Company-specific information has been redacted with underscores.

We are using ReviewBoard 1.7.5, in case that matters.

Cheers,
M

-- 
Want to help the Review Board project? Donate today at 
http://www.reviewboard.org/donate/
Happy user? Let us know at http://www.reviewboard.org/users/
-~--~~~~--~~--~--~---
To unsubscribe from this group, send email to 
reviewboard+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/reviewboard?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"reviewboard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to reviewboard+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: python API: target_people access fails

2013-03-22 Thread Steven MacLeod
That looks correct. I'm not quire sure what's going wrong.

Could you provide me with the JSON payload being used to create the review
request resource. You can get this by running:


review_requests = rb_conn.get_root().get_review_
requests(time_added_from=time_added, status='pending', max_results=1)

for rr in review_requests:
print rr._resource._payload


On Fri, Mar 22, 2013 at 1:55 PM, A.M.  wrote:

> Hello,
>
> I am trying to extract user names from the review_request.target_people but
> I receive an unexpected exception.
>
> review_requests =
> rb_conn.get_root().get_review_requests(time_added_from=time_added,
>
> status='pending',max_results=1)
> for rr in review_requests:
> for reviewer in rr.target_people:
> print reviewer
>
> Traceback (most recent call last):
>   File "rbpoller.py", line 129, in 
> send_rb_fresh_emails()
>   File "rbpoller.py", line 97, in send_rb_fresh_emails
> for reviewer in rr.target_people:
>   File "build/bdist.linux-x86_64/egg/rbtools/api/transport/sync.py", line
> 142, in next
>   File "build/bdist.linux-x86_64/egg/rbtools/api/transport/sync.py", line
> 162, in __getitem__
>   File "build/bdist.linux-x86_64/egg/rbtools/api/transport/sync.py", line
> 71, in wrap
> TypeError: __init__() keywords must be strings
>
>
> My understanding is that the ResourceListField should be iterable. Am I
> doing something incorrectly?
>
> Cheers,
> M
>
> --
> Want to help the Review Board project? Donate today at
> http://www.reviewboard.org/donate/
> Happy user? Let us know at http://www.reviewboard.org/users/
> -~--~~~~--~~--~--~---
> To unsubscribe from this group, send email to
> reviewboard+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/reviewboard?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "reviewboard" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to reviewboard+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
Want to help the Review Board project? Donate today at 
http://www.reviewboard.org/donate/
Happy user? Let us know at http://www.reviewboard.org/users/
-~--~~~~--~~--~--~---
To unsubscribe from this group, send email to 
reviewboard+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/reviewboard?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"reviewboard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to reviewboard+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.