← Back to team overview

launchpad-reviewers team mailing list archive

Re: [Merge] lp:~cjwatson/launchpad/ttb-from-disk into lp:launchpad

 

Review: Approve code



Diff comments:

> 
> === modified file 'lib/lp/translations/model/translationimportqueue.py'
> --- lib/lp/translations/model/translationimportqueue.py	2015-07-08 16:05:11 +0000
> +++ lib/lp/translations/model/translationimportqueue.py	2017-04-19 11:20:19 +0000
> @@ -1030,6 +1030,20 @@
>          return (
>              format, translation_importer.getTranslationFormatImporter(format))
>  
> +    def _getFileObjectAndSize(self, file_or_data):
> +        """Get the size of a seekable file object."""
> +        if (isinstance(file_or_data, bytes) or
> +                isinstance(file_or_data, unicode)):

basestring?

> +            file_obj = BytesIO(file_or_data)
> +            file_size = len(file_or_data)
> +        else:
> +            file_obj = file_or_data
> +            start = file_obj.tell()
> +            file_obj.seek(0, os.SEEK_END)
> +            file_size = file_obj.tell()
> +            file_obj.seek(start)
> +        return file_obj, file_size
> +
>      def addOrUpdateEntry(self, path, content, by_maintainer, importer,
>                           sourcepackagename=None, distroseries=None,
>                           productseries=None, potemplate=None, pofile=None,


-- 
https://code.launchpad.net/~cjwatson/launchpad/ttb-from-disk/+merge/322759
Your team Launchpad code reviewers is subscribed to branch lp:launchpad.


References