@@ -318,7 +318,7 @@ def readable_datetime(datetime_str):
318318 else :
319319 return "{}{}ago" .format (hour_str , min_str )
320320 # if it happened yesterday, say "yesterday at 3:23 pm"
321- yesterday = now + relativedelta .relativedelta (days = - 1 )
321+ yesterday = now + relativedelta .relativedelta (days = - 1 )
322322 if delta .days <= 2 and dt .day == yesterday .day :
323323 return dt .strftime ("Yesterday at %X" )
324324 # otherwise return locale-specific date/time format
@@ -1033,12 +1033,13 @@ def clusters_update(self, args):
10331033 if k == 'auth' and args .get ('--auth' ) is not None :
10341034 auth_path = os .path .expanduser (args ['--auth' ])
10351035 if not os .path .exists (auth_path ):
1036- print ('Path to authentication credentials does not exist: {}' .format (auth_path ))
1036+ print (
1037+ "Path to authentication credentials does not exist: {}" .format (auth_path ))
10371038 sys .exit (1 )
10381039 with open (auth_path ) as f :
10391040 data = f .read ()
10401041 body .update ({'auth' : base64 .b64encode (data )})
1041- else :
1042+ else :
10421043 v = args .get (arg )
10431044 if v :
10441045 body .update ({k : v })
@@ -1176,7 +1177,8 @@ def config_unset(self, args):
11761177 try :
11771178 progress = TextProgress ()
11781179 progress .start ()
1179- response = self ._dispatch ('post' , "/api/apps/{}/config" .format (app ), json .dumps (body ))
1180+ response = self ._dispatch (
1181+ 'post' , "/api/apps/{}/config" .format (app ), json .dumps (body ))
11801182 finally :
11811183 progress .cancel ()
11821184 progress .join ()
@@ -1230,10 +1232,8 @@ def config_pull(self, args):
12301232 if response .status_code == requests .codes .ok : # @UndefinedVariable
12311233 config = json .loads (response .json ()['values' ])
12321234 for k , v in config .items ():
1233- if interactive :
1234- confirm = raw_input ('overwrite {} with {}? (y/N) ' .format (k , v ))
1235- if confirm == 'y' :
1236- env_dict [k ] = v
1235+ if interactive and raw_input ("overwrite {} with {}? (y/N) " .format (k , v )) == 'y' :
1236+ env_dict [k ] = v
12371237 if k in env_dict and not overwrite :
12381238 continue
12391239 env_dict [k ] = v
@@ -1284,7 +1284,8 @@ def domains_add(self, args):
12841284 try :
12851285 progress = TextProgress ()
12861286 progress .start ()
1287- response = self ._dispatch ('post' , "/api/apps/{app}/domains" .format (app = app ), json .dumps (body ))
1287+ response = self ._dispatch (
1288+ 'post' , "/api/apps/{app}/domains" .format (app = app ), json .dumps (body ))
12881289 finally :
12891290 progress .cancel ()
12901291 progress .join ()
@@ -1316,7 +1317,8 @@ def domains_remove(self, args):
13161317 try :
13171318 progress = TextProgress ()
13181319 progress .start ()
1319- response = self ._dispatch ('delete' , "/api/apps/{app}/domains/{domain}" .format (** locals ()))
1320+ response = self ._dispatch (
1321+ 'delete' , "/api/apps/{app}/domains/{domain}" .format (** locals ()))
13201322 finally :
13211323 progress .cancel ()
13221324 progress .join ()
0 commit comments