def is_archive(path):
 if zipfile.is_zipfile(path):
  try:
   zf = zipfile.ZipFile(path)
   return (0, zf, '.zip')
  except:
   return ((-1), None, '')
 elif rarfile.is_rarfile(path):
  try:
   zf = rarfile.RarFile(path)
   rarfile.UNRAR_TOOL = sabnzbd.newsunpack.RAR_COMMAND
   return (0, zf, '.rar')
  except:
   return ((-1), None, '')
 elif is_sevenfile(path):
  try:
   zf = SevenZip(path)
   return (0, zf, '.7z')
  except:
   return ((-1), None, '')
 else:
  return (1, None, '')

def is_archive ( path ) : if zipfile . is_zipfile ( path ) : try : zf = zipfile . ZipFile ( path ) return ( 0 , zf , '.zip' ) except : return ( ( - 1 ) , None , '' ) elif rarfile . is_rarfile ( path ) : try : zf = rarfile . RarFile ( path ) rarfile . UNRAR_TOOL = sabnzbd . newsunpack . RAR_COMMAND return ( 0 , zf , '.rar' ) except : return ( ( - 1 ) , None , '' ) elif is_sevenfile ( path ) : try : zf = SevenZip ( path ) return ( 0 , zf , '.7z' ) except : return ( ( - 1 ) , None , '' ) else : return ( 1 , None , '' )
check if file in path is an zip .