Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(129)

Side by Side Diff: boto/gs/acl.py

Issue 8669001: Pull in upstream boto from github at bcb719937de9ac2851e632d62b777352029a6d55 (Closed) Base URL: svn://svn.chromium.org/boto
Patch Set: Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « boto/ec2/instance.py ('k') | boto/gs/bucket.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2010 Google Inc. 1 # Copyright 2010 Google Inc.
2 # 2 #
3 # Permission is hereby granted, free of charge, to any person obtaining a 3 # Permission is hereby granted, free of charge, to any person obtaining a
4 # copy of this software and associated documentation files (the 4 # copy of this software and associated documentation files (the
5 # "Software"), to deal in the Software without restriction, including 5 # "Software"), to deal in the Software without restriction, including
6 # without limitation the rights to use, copy, modify, merge, publish, dis- 6 # without limitation the rights to use, copy, modify, merge, publish, dis-
7 # tribute, sublicense, and/or sell copies of the Software, and to permit 7 # tribute, sublicense, and/or sell copies of the Software, and to permit
8 # persons to whom the Software is furnished to do so, subject to the fol- 8 # persons to whom the Software is furnished to do so, subject to the fol-
9 # lowing conditions: 9 # lowing conditions:
10 # 10 #
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 self.parent = parent 54 self.parent = parent
55 self.entries = [] 55 self.entries = []
56 56
57 @property 57 @property
58 def acl(self): 58 def acl(self):
59 return self 59 return self
60 60
61 def __repr__(self): 61 def __repr__(self):
62 # Owner is optional in GS ACLs. 62 # Owner is optional in GS ACLs.
63 if hasattr(self, 'owner'): 63 if hasattr(self, 'owner'):
64 entries_repr = ['Owner:%s' % self.owner.__repr__()]
65 else:
64 entries_repr = [''] 66 entries_repr = ['']
65 else:
66 entries_repr = ['Owner:%s' % self.owner.__repr__()]
67 acl_entries = self.entries 67 acl_entries = self.entries
68 if acl_entries: 68 if acl_entries:
69 for e in acl_entries.entry_list: 69 for e in acl_entries.entry_list:
70 entries_repr.append(e.__repr__()) 70 entries_repr.append(e.__repr__())
71 return '<%s>' % ', '.join(entries_repr) 71 return '<%s>' % ', '.join(entries_repr)
72 72
73 # Method with same signature as boto.s3.acl.ACL.add_email_grant(), to allow 73 # Method with same signature as boto.s3.acl.ACL.add_email_grant(), to allow
74 # polymorphic treatment at application layer. 74 # polymorphic treatment at application layer.
75 def add_email_grant(self, permission, email_address): 75 def add_email_grant(self, permission, email_address):
76 entry = Entry(type=USER_BY_EMAIL, email_address=email_address, 76 entry = Entry(type=USER_BY_EMAIL, email_address=email_address,
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
271 s += '<%s>%s</%s>' % (NAME, self.name, NAME) 271 s += '<%s>%s</%s>' % (NAME, self.name, NAME)
272 elif self.type == GROUP_BY_ID or self.type == USER_BY_ID: 272 elif self.type == GROUP_BY_ID or self.type == USER_BY_ID:
273 s += '<%s>%s</%s>' % (ID, self.id, ID) 273 s += '<%s>%s</%s>' % (ID, self.id, ID)
274 if self.name: 274 if self.name:
275 s += '<%s>%s</%s>' % (NAME, self.name, NAME) 275 s += '<%s>%s</%s>' % (NAME, self.name, NAME)
276 else: 276 else:
277 raise InvalidAclError('Invalid scope type "%s" ', self.type) 277 raise InvalidAclError('Invalid scope type "%s" ', self.type)
278 278
279 s += '</%s>' % SCOPE 279 s += '</%s>' % SCOPE
280 return s 280 return s
OLDNEW
« no previous file with comments | « boto/ec2/instance.py ('k') | boto/gs/bucket.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698