diff --git a/README.md b/README.md index b38ce2d..0439dac 100644 --- a/README.md +++ b/README.md @@ -30,6 +30,12 @@ sudo apt-get install python-yaml # in Ubuntu yum install python-yaml # in CentOS ``` + +# for arrow dependency +``` +pip install arrow +``` + # Recommended utility ``` diff --git a/history.py b/history.py index d9a578d..392bd12 100755 --- a/history.py +++ b/history.py @@ -7,6 +7,7 @@ import sys import os.path import yaml +import arrow def login(name, password): url = "http://owl.fastweb.com.cn/api/v1/auth/login" @@ -91,13 +92,16 @@ def readConf(): if __name__ == "__main__": if len(sys.argv) != 4: - print "usage: ./history.py [timestampStart] [timestampEnd] [platformName]" - print "example: ./history.py 1478700000 1478764076 c01.i07" + print "usage: ./history.py [time Start in ISO8601] [time End in ISO8601] [platformName]" + print "example: ./history.py 2017-02-28T06:01:00+0800 2017-03-28T06:01:00+0800 c01.i07" sys.exit(1) #ts = int(time.time()) # input #platform = "c06.i06" # input - startTs = int(sys.argv[1]) # input - endTs = int(sys.argv[2]) # input + sTime = arrow.get(sys.argv[1]) + eTime = arrow.get(sys.argv[2]) + startTs = sTime.timestamp + endTs = eTime.timestamp + platform = sys.argv[3] # input user = "" # data password = "" # data