Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(33)

Issue 5528104: Added a sample to demonstarte Email Audit api's email monitor CRUD operations

Can't Edit
Can't Publish+Mail
Start Review
Created:
14 years, 5 months ago by gunjansharma
Modified:
14 years, 5 months ago
CC:
gdata-python-client-library-contributors_googlegroups.com
Visibility:
Public.

Patch Set 1 #

Total comments: 17

Patch Set 2 : Patch1 #

Patch Set 3 : patch1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+283 lines, -0 lines) Patch
A samples/apps/email_audit_email_monitoring.py View 1 2 1 chunk +283 lines, -0 lines 0 comments Download

Messages

Total messages: 9
gunjansharma
14 years, 5 months ago (2012-01-16 10:14:20 UTC) #1
danielholevoet
http://codereview.appspot.com/5528104/diff/1/samples/apps/email_audit_email_monitoring.py File samples/apps/email_audit_email_monitoring.py (right): http://codereview.appspot.com/5528104/diff/1/samples/apps/email_audit_email_monitoring.py#newcode35 samples/apps/email_audit_email_monitoring.py:35: You shouldn't need to define __init__ for this class. ...
14 years, 5 months ago (2012-01-20 23:47:16 UTC) #2
gunjansharma
14 years, 5 months ago (2012-01-21 07:41:08 UTC) #3
gunjansharma
http://codereview.appspot.com/5528104/diff/1/samples/apps/email_audit_email_monitoring.py File samples/apps/email_audit_email_monitoring.py (right): http://codereview.appspot.com/5528104/diff/1/samples/apps/email_audit_email_monitoring.py#newcode35 samples/apps/email_audit_email_monitoring.py:35: On 2012/01/20 23:47:16, danielholevoet wrote: > You shouldn't need ...
14 years, 5 months ago (2012-01-21 07:41:53 UTC) #4
gunjansharma
14 years, 5 months ago (2012-01-21 12:44:50 UTC) #5
Vic Fryzel
http://codereview.appspot.com/5528104/diff/1/samples/apps/email_audit_email_monitoring.py File samples/apps/email_audit_email_monitoring.py (right): http://codereview.appspot.com/5528104/diff/1/samples/apps/email_audit_email_monitoring.py#newcode35 samples/apps/email_audit_email_monitoring.py:35: On 2012/01/21 07:41:53, gunjansharma wrote: > On 2012/01/20 23:47:16, ...
14 years, 5 months ago (2012-01-22 06:32:20 UTC) #6
gunjansharma
http://codereview.appspot.com/5528104/diff/1/samples/apps/email_audit_email_monitoring.py File samples/apps/email_audit_email_monitoring.py (right): http://codereview.appspot.com/5528104/diff/1/samples/apps/email_audit_email_monitoring.py#newcode35 samples/apps/email_audit_email_monitoring.py:35: On 2012/01/22 06:32:21, Vic Fryzel wrote: > On 2012/01/21 ...
14 years, 5 months ago (2012-01-23 12:16:28 UTC) #7
danielholevoet
http://codereview.appspot.com/5528104/diff/1/samples/apps/email_audit_email_monitoring.py File samples/apps/email_audit_email_monitoring.py (right): http://codereview.appspot.com/5528104/diff/1/samples/apps/email_audit_email_monitoring.py#newcode35 samples/apps/email_audit_email_monitoring.py:35: On 2012/01/23 12:16:28, gunjansharma wrote: > On 2012/01/22 06:32:21, ...
14 years, 5 months ago (2012-01-23 18:24:45 UTC) #8
Vic Fryzel
14 years, 5 months ago (2012-01-23 20:15:10 UTC) #9
LGTM with constructor removed.

http://codereview.appspot.com/5528104/diff/1/samples/apps/email_audit_email_m...
File samples/apps/email_audit_email_monitoring.py (right):

http://codereview.appspot.com/5528104/diff/1/samples/apps/email_audit_email_m...
samples/apps/email_audit_email_monitoring.py:35: 
Gunjan can you just delete the constructor really quick?  That might be easiest.

http://codereview.appspot.com/5528104/diff/1/samples/apps/email_audit_email_m...
samples/apps/email_audit_email_monitoring.py:59: self._Authorize()
On 2012/01/23 18:24:46, danielholevoet wrote:
> On 2012/01/22 06:32:21, Vic Fryzel wrote:
> > On 2012/01/21 07:41:53, gunjansharma wrote:
> > > On 2012/01/20 23:47:16, danielholevoet wrote:
> > > > Having simple constructors is better. I would move the call to
_Authorize
> > out
> > > > into it's own step (perhaps making it public).
> > > This has been a question of debate in the previous samples as well.
Finally
> > Vic
> > > asked me to include it in the constructor itself.
> > 
> > +1.  @Dan I asked him to put it here so that the class could not be
> initialized
> > into a bad state, as other methods depend on authorization having succeeded.
> 
> Since other samples do it this way, leave it for consistency.
> 
> In future samples, using a factory method might be a better approach. E.g:
> 
> @staticmethod
> def CreateAuthorizedInstance():
>   o = EmailMonitoring()
>   o.Authorize()
>   return o
> 
> You still need to stub out Authorize when testing this method, but not when
just
> testing the basic constructor (which will be very useful when writing tests).

+1.  Gunjan please do this in the future, but it's not necessary now.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b