@@ -48,23 +48,31 @@ def get_parser(self, prog_name):
4848 parser .add_argument (
4949 '--name' ,
5050 metavar = '<name>' ,
51- help = _ ('Upload a file and rename it. '
52- 'Can only be used when uploading a single object' )
51+ help = _ (
52+ 'Upload a file and rename it. '
53+ 'Can only be used when uploading a single object'
54+ ),
5355 )
5456 return parser
5557
5658 def take_action (self , parsed_args ):
5759 if parsed_args .name :
5860 if len (parsed_args .objects ) > 1 :
59- msg = _ ('Attempting to upload multiple objects and '
60- 'using --name is not permitted' )
61+ msg = _ (
62+ 'Attempting to upload multiple objects and '
63+ 'using --name is not permitted'
64+ )
6165 raise exceptions .CommandError (msg )
6266 results = []
6367 for obj in parsed_args .objects :
6468 if len (obj ) > 1024 :
6569 LOG .warning (
66- _ ('Object name is %s characters long, default limit'
67- ' is 1024' ), len (obj ))
70+ _ (
71+ 'Object name is %s characters long, default limit'
72+ ' is 1024'
73+ ),
74+ len (obj ),
75+ )
6876 data = self .app .client_manager .object_store .object_create (
6977 container = parsed_args .container ,
7078 object = obj ,
@@ -73,11 +81,17 @@ def take_action(self, parsed_args):
7381 results .append (data )
7482
7583 columns = ("object" , "container" , "etag" )
76- return (columns ,
77- (utils .get_dict_properties (
78- s , columns ,
84+ return (
85+ columns ,
86+ (
87+ utils .get_dict_properties (
88+ s ,
89+ columns ,
7990 formatters = {},
80- ) for s in results ))
91+ )
92+ for s in results
93+ ),
94+ )
8195
8296
8397class DeleteObject (command .Command ):
@@ -99,7 +113,6 @@ def get_parser(self, prog_name):
99113 return parser
100114
101115 def take_action (self , parsed_args ):
102-
103116 for obj in parsed_args .objects :
104117 self .app .client_manager .object_store .object_delete (
105118 container = parsed_args .container ,
@@ -158,7 +171,6 @@ def get_parser(self, prog_name):
158171 return parser
159172
160173 def take_action (self , parsed_args ):
161-
162174 if parsed_args .long :
163175 columns = (
164176 'Name' ,
@@ -185,15 +197,20 @@ def take_action(self, parsed_args):
185197 kwargs ['full_listing' ] = True
186198
187199 data = self .app .client_manager .object_store .object_list (
188- container = parsed_args .container ,
189- ** kwargs
200+ container = parsed_args .container , ** kwargs
190201 )
191202
192- return (columns ,
193- (utils .get_dict_properties (
194- s , columns ,
203+ return (
204+ columns ,
205+ (
206+ utils .get_dict_properties (
207+ s ,
208+ columns ,
195209 formatters = {},
196- ) for s in data ))
210+ )
211+ for s in data
212+ ),
213+ )
197214
198215
199216class SaveObject (command .Command ):
@@ -204,8 +221,10 @@ def get_parser(self, prog_name):
204221 parser .add_argument (
205222 "--file" ,
206223 metavar = "<filename>" ,
207- help = _ ("Destination filename (defaults to object name); using '-'"
208- " as the filename will print the file to stdout" ),
224+ help = _ (
225+ "Destination filename (defaults to object name); using '-'"
226+ " as the filename will print the file to stdout"
227+ ),
209228 )
210229 parser .add_argument (
211230 'container' ,
@@ -247,8 +266,10 @@ def get_parser(self, prog_name):
247266 metavar = "<key=value>" ,
248267 required = True ,
249268 action = parseractions .KeyValueAction ,
250- help = _ ("Set a property on this object "
251- "(repeat option to set multiple properties)" )
269+ help = _ (
270+ "Set a property on this object "
271+ "(repeat option to set multiple properties)"
272+ ),
252273 )
253274 return parser
254275
@@ -278,7 +299,6 @@ def get_parser(self, prog_name):
278299 return parser
279300
280301 def take_action (self , parsed_args ):
281-
282302 data = self .app .client_manager .object_store .object_show (
283303 container = parsed_args .container ,
284304 object = parsed_args .object ,
@@ -310,8 +330,10 @@ def get_parser(self, prog_name):
310330 required = True ,
311331 action = 'append' ,
312332 default = [],
313- help = _ ('Property to remove from object '
314- '(repeat option to remove multiple properties)' ),
333+ help = _ (
334+ 'Property to remove from object '
335+ '(repeat option to remove multiple properties)'
336+ ),
315337 )
316338 return parser
317339
0 commit comments