Logo Search packages:      
Sourcecode: calibre version File versions

def calibre::devices::prs500::driver::PRS500::path_properties (   self,
  path,
  end_session = True 
)

Send command asking device for properties of C{path}.
Return L{FileProperties}.

Definition at line 436 of file driver.py.

00436                                                      :
        """
        Send command asking device for properties of C{path}.
        Return L{FileProperties}.
        """
        res  = self.send_validated_command(PathQuery(path), \
                                                    response_type=ListResponse)
        data = self._bulk_read(0x28, data_type=FileProperties, \
                                           command_number=PathQuery.NUMBER)[0]
        if path.endswith('/') and path != '/':
            path = path[:-1]
        if res.path_not_found :
            raise PathError(path + " does not exist on device")
        if res.is_invalid:
            raise PathError(path + " is not a valid path")
        if res.is_unmounted:
            raise PathError(path + " is not mounted")
        if res.permission_denied:
            raise PathError('Permission denied for: ' + path + '\nYou can only '+\
                            'operate on paths starting with /Data, a:/ or b:/')
        if res.code not in (0, PathResponseCodes.IS_FILE):
            raise PathError(path + " has an unknown error. Code: " + \
                                        hex(res.code))
        return data

    @safe
    def get_file(self, path, outfile, end_session=True):


Generated by  Doxygen 1.6.0   Back to index