示例#1
0
 def import_doc(file_uri, docsearch, current_doc=None):
     """
     Import the specified image
     """
     logger.info("Importing doc '%s'" % (file_uri))
     if current_doc is None:
         current_doc = ImgDoc(docsearch.rootdir)
     new = current_doc.is_new
     if file_uri[:7] == "file://":
         # XXX(Jflesch): bad bad bad
         file_uri = urllib.unquote(file_uri[7:])
     img = Image.open(file_uri)
     page = current_doc.add_page(img, [])
     return ([current_doc], page, new)
示例#2
0
 def import_doc(file_uri, config, docsearch, current_doc=None):
     """
     Import the specified image
     """
     logger.info("Importing doc '%s'" % (file_uri))
     if current_doc is None:
         current_doc = ImgDoc(config.settings['workdir'].value)
     new = current_doc.is_new
     if file_uri[:7] == "file://":
         # XXX(Jflesch): bad bad bad
         file_uri = file_uri[7:]
     img = Image.open(file_uri)
     page = current_doc.add_page(img, [])
     return ([current_doc], page, new)