File tree 2 files changed +8
-3
lines changed
2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -279,7 +279,7 @@ def team_document(self) -> Detail:
279
279
"""Returns usage details for documents shared among your team."""
280
280
return self ._team_document
281
281
282
- def __str__ (self ):
282
+ def __str__ (self ) -> str :
283
283
details : List [Tuple [str , Usage .Detail ]] = [
284
284
("Characters" , self .character ),
285
285
("Documents" , self .document ),
@@ -312,7 +312,7 @@ def __str__(self):
312
312
return self .code
313
313
314
314
@staticmethod
315
- def remove_regional_variant (language : Union [str ]) -> str :
315
+ def remove_regional_variant (language : Union [str , "Language" ]) -> str :
316
316
"""Removes the regional variant from a language, e.g. EN-US gives EN"""
317
317
return str (language ).upper ()[0 :2 ]
318
318
Original file line number Diff line number Diff line change @@ -732,7 +732,12 @@ def translate_document_download(
732
732
)
733
733
734
734
if output_file :
735
- for chunk in response .iter_content (chunk_size = chunk_size ):
735
+ chunks = (
736
+ response .iter_content (chunk_size = chunk_size )
737
+ if isinstance (response , requests .Response )
738
+ else [response ]
739
+ )
740
+ for chunk in chunks :
736
741
output_file .write (chunk )
737
742
return None
738
743
else :
You can’t perform that action at this time.
0 commit comments