def post(self):
        upload_files = self.get_uploads("file")
        blob_info = upload_files[0]
        blob_key = blob_info.key()

        logging.info('(REFACTORED) filename %s key %s', blob_info.filename, blob_key)

        BlobDataset.create(blob_key, filename=blob_info.filename)

        self.redirect("/blobs2")
Beispiel #2
0
    def post(self):
        upload_files = self.get_uploads("file")
        blob_info = upload_files[0]
        blob_key = blob_info.key()

        logging.info('(REFACTORED) filename %s key %s', blob_info.filename,
                     blob_key)

        BlobDataset.create(blob_key, filename=blob_info.filename)

        self.redirect("/blobs2")
def pre_process(data):
    logging.info("Peer Belt > pre_process() called.")
    (blob_key, file_no, line) = (data[0][0], data[0][1], data[1])
    found_pattern = text_file_pattern.search(line)
    if not found_pattern:
        return
    (_id, text) = (found_pattern.group(1), found_pattern.group(2))

    dataset = BlobDataset.query(BlobDataset.blob_key == get_blob_key(blob_key)).get()

    return (dataset, _id, text)
    def pre_process(cls, data):
        (blob_key, file_no, line) = (data[0][0], data[0][1], data[1])
        found_pattern = text_file_pattern.search(line)
        if not found_pattern:
            return
        (_id, text) = (found_pattern.group(1), found_pattern.group(2))

        dataset = BlobDataset.query(BlobDataset.blob_key == get_blob_key(blob_key)).get()
        text = parse_text(text)

        return (dataset, _id, text)
def pre_process(data):
    logging.info("Peer Belt > pre_process() called.")
    (blob_key, file_no, line) = (data[0][0], data[0][1], data[1])
    found_pattern = text_file_pattern.search(line)
    if not found_pattern:
        return
    (_id, text) = (found_pattern.group(1), found_pattern.group(2))

    dataset = BlobDataset.query(BlobDataset.blob_key == get_blob_key(blob_key)).get()

    return (dataset, _id, text)
    def get(self):
        logging.info('Peer Belt Driver get method called!')
        user = users.get_current_user()
        username = user.nickname()

        results = BlobDataset.query()
        items = [result for result in results]

        for item in items:
            item.ds_key = item.key.urlsafe()
        length = len(items)

        upload_url = create_upload_url("upload_blob2")

        self.response.out.write(self.template_env.get_template("blobs2.html").render(
            {"username": username,
             "items": items,
             "length": length,
             "upload_url": upload_url}))
    def get(self):
        logging.info(os.path.abspath(os.path.curdir))
        logging.info('Peer Belt Driver get method called!')
        user = users.get_current_user()
        username = user.nickname()

        results = BlobDataset.query()
        items = [result for result in results]

        for item in items:
            item.ds_key = item.key.urlsafe()
        length = len(items)

        upload_url = create_upload_url("upload_blob2")

        self.response.out.write(self.template_env.get_template("blobs2.html").render(
            {"username": username,
             "items": items,
             "length": length,
             "upload_url": upload_url}))