Skip to content

Commit

Permalink
add iso8601 support
Browse files Browse the repository at this point in the history
  • Loading branch information
humorless committed Mar 29, 2017
1 parent 8927e58 commit e523bfb
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

```
Expand Down
12 changes: 8 additions & 4 deletions history.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit e523bfb

Please sign in to comment.