original_docstring: Find one or more files using the name and/or hash in Dropbox.
docstring: Find one or more files using the name and/or hash in Dropbox.
docstring_tokens: Find one or more files using the name and / or hash in Dropbox .
code: def find_file(self, name=None, md5=None, sha1=None):
          """Find one or more files using the name and/or hash in Dropbox."""
          if not name and (md5 or sha1):
              """Dropbox doesn't support hash searching at this time."""
              logger.error("Dropbox does not currently support hash searching.")
              raise ValueError("Dropbox does not support hash only searching.")
  
          matches = []
          # TODO: https://www.dropbox.com/developers/reference/content-hash
          for f in self.folders:
              start = 0
              while True:
                  res = self.client.files_search(f, name, start=start)
                  if len(res.matches):
                      # matches were found
                      for m in res.matches:
                          matches.append(self.convert_file(m))
                  if res.more:
                      start = res.start
                  else:
                      break
  
          return matches
code_tokens: def find_file ( self , name = None , md5 = None , sha1 = None ) : if not name and ( md5 or sha1 ) : """Dropbox doesn't support hash searching at this time.""" logger . error ( "Dropbox does not currently support hash searching." ) raise ValueError ( "Dropbox does not support hash only searching." ) matches = [ ] for f in self . folders : start = 0 while True : res = self . client . files_search ( f , name , start = start ) if len ( res . matches ) : for m in res . matches : matches . append ( self . convert_file ( m ) ) if res . more : start = res . start else : break return matches
short_docstring: Find one or more files using the name and/or hash in Dropbox.
short_docstring_tokens: Find one or more files using the name and / or hash in Dropbox .
comment: """Find one or more files using the name and/or hash in Dropbox."""$SEP$"""Dropbox doesn't support hash searching at this time."""$SEP$# TODO: https://www.dropbox.com/developers/reference/content-hash$SEP$# matches were found