ó
²,]c           @   sD   d  Z  d d l Z d d l m Z m Z e j e  Z d   Z d S(   sı   
binaryornot.check
-----------------

Main code for checking if a file is binary or text.

Adapted from binaryornot/check.py of
`BinaryOrNot <https://github.com/audreyr/binaryornot>`_.
i˙˙˙˙N(   t   get_starting_chunkt   is_binary_stringc         C   s_   t  j d t    d d d d g } x! | D] } |  j |  r, t Sq, Wt |   } t |  S(   sd   
    :param filename: File to check.
    :returns: True if it's a binary file, otherwise False.
    s   is_binary: %(filename)rt   pyct   isot   zipt   pdf(   t   loggert   debugt   localst   endswitht   TrueR    R   (   t   filenamet   binary_extensionst   extt   chunk(    (    sF   lib/python2.7/site-packages/spyder/utils/external/binaryornot/check.pyt	   is_binary   s    (	   t   __doc__t   loggingt)   spyder.utils.external.binaryornot.helpersR    R   t	   getLoggert   __name__R   R   (    (    (    sF   lib/python2.7/site-packages/spyder/utils/external/binaryornot/check.pyt   <module>   s   