#!/usr/bin/env python2 # $Id: setup.py,v 1.1 2002/03/27 08:24:57 wyy Exp $ # # William Emmanuel S. YU # Ateneo de Manila University, Philippines # # Python Bindings for OSU Flowtools # Copyright (C) 2002 William Emmanuel S. Yu # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # import PyFlow import time # get output from file descriptor 0 which is standard input obj = PyFlow.open(0) print obj out = PyFlow.read(obj) while out: dtime = out[0] src = out[1] dst = out[2] print "Start Time :", time.localtime(dtime[0]) print "Stop Time :", time.localtime(dtime[1]) print "Source :", src print "Destination :", dst print "Usage :", out[4] out = PyFlow.read(obj)