From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 3108E1381F3 for ; Mon, 29 Jul 2013 16:08:30 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 9E25DE0933; Mon, 29 Jul 2013 16:08:27 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 2A38CE08E8 for ; Mon, 29 Jul 2013 16:08:26 +0000 (UTC) Received: from hornbill.gentoo.org (hornbill.gentoo.org [94.100.119.163]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 06DCB33E834 for ; Mon, 29 Jul 2013 16:08:26 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id 8BB45E468F for ; Mon, 29 Jul 2013 16:08:24 +0000 (UTC) From: "Antanas Ursulis" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Antanas Ursulis" Message-ID: <1374098599.5640153330f6ff8935009f1570563c48a088aef5.uranium@gentoo> Subject: [gentoo-commits] proj/log-analysis:master commit in: / X-VCS-Repository: proj/log-analysis X-VCS-Files: simple_client.py X-VCS-Directories: / X-VCS-Committer: uranium X-VCS-Committer-Name: Antanas Ursulis X-VCS-Revision: 5640153330f6ff8935009f1570563c48a088aef5 X-VCS-Branch: master Date: Mon, 29 Jul 2013 16:08:24 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: d4ed08c0-bef1-4f07-be70-9d24f8f82e60 X-Archives-Hash: 0ea3df5d1e52df6e5ce4b90acfc13cc7 commit: 5640153330f6ff8935009f1570563c48a088aef5 Author: Antanas Uršulis gmail com> AuthorDate: Wed Jul 17 22:03:19 2013 +0000 Commit: Antanas Ursulis gmail com> CommitDate: Wed Jul 17 22:03:19 2013 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/log-analysis.git;a=commit;h=56401533 Send only filename, not full path --- simple_client.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/simple_client.py b/simple_client.py index 0335260..3abc7c9 100644 --- a/simple_client.py +++ b/simple_client.py @@ -2,14 +2,14 @@ Simple submission client that forms a correct protobuf message and performs a POST """ -import submission_pb2, sys, urllib +import submission_pb2, sys, urllib, os def send_submission(filenames): submission = submission_pb2.Submission() for f in filenames: new_file = submission.files.add() - new_file.filename = f + new_file.filename = os.path.basename(f) new_file.data = open(f, 'rb').read() print urllib.urlopen('http://[::1]:5000/submit', submission.SerializeToString()).read()