def download_content_pack(fobj, lang, minimal=False):
 url = CONTENT_PACK_URL_TEMPLATE.format(version=SHORTVERSION, langcode=lang, suffix=('-minimal' if minimal else ''))
 logging.info('Downloading content pack from {}'.format(url))
 httpf = urllib.urlopen(url)
 shutil.copyfileobj(httpf, fobj)
 fobj.seek(0)
 zf = zipfile.ZipFile(fobj)
 httpf.close()
 return zf

def download_content_pack ( fobj , lang , minimal = False ) : url = CONTENT_PACK_URL_TEMPLATE . format ( version = SHORTVERSION , langcode = lang , suffix = ( '-minimal' if minimal else '' ) ) logging . info ( 'Downloading content pack from {}' . format ( url ) ) httpf = urllib . urlopen ( url ) shutil . copyfileobj ( httpf , fobj ) fobj . seek ( 0 ) zf = zipfile . ZipFile ( fobj ) httpf . close ( ) return zf
given a file object where the content pack lang will be stored .