def find_magic_file(self, fname, system_only=False, user_only=False):
        '''
        Finds the specified magic file name in the system / user magic file directories.

        @fname       - The name of the magic file.
        @system_only - If True, only the system magic file directory will be searched.
        @user_only   - If True, only the user magic file directory will be searched.

        If system_only and user_only are not set, the user directory is always searched first.

        Returns the path to the file on success; returns None on failure.
        '''
        loc = None

        if not system_only:
            fpath = self._user_path(self.BINWALK_MAGIC_DIR, fname)
            if os.path.exists(fpath) and common.file_size(fpath) > 0:
                loc = fpath

        if loc is None and not user_only:
            fpath = self._system_path(self.BINWALK_MAGIC_DIR, fname)
            if os.path.exists(fpath) and common.file_size(fpath) > 0:
                loc = fpath

        return fpath
def find_magic_file ( self , fname , system_only = False , user_only = False ) : loc = None if not system_only : fpath = self . _user_path ( self . BINWALK_MAGIC_DIR , fname ) if os . path . exists ( fpath ) and common . file_size ( fpath ) > 0 : loc = fpath if loc is None and not user_only : fpath = self . _system_path ( self . BINWALK_MAGIC_DIR , fname ) if os . path . exists ( fpath ) and common . file_size ( fpath ) > 0 : loc = fpath return fpath
Finds the specified magic file name in the system / user magic file directories.

        @fname       - The name of the magic file.
        @system_only - If True, only the system magic file directory will be searched.
        @user_only   - If True, only the user magic file directory will be searched.

        If system_only and user_only are not set, the user directory is always searched first.

        Returns the path to the file on success; returns None on failure.