Merge "Specify ATC contribution start/end in seconds"
This commit is contained in:
commit
bb941b2026
@ -13,12 +13,12 @@ elections and Summit invitations.
|
|||||||
virtualenv venv
|
virtualenv venv
|
||||||
. venv/bin/activate
|
. venv/bin/activate
|
||||||
pip install paramiko requests pyyaml
|
pip install paramiko requests pyyaml
|
||||||
./email_stats.py --begin <BEGINDATE>
|
./email_stats.py --begin <BEGINTIME>
|
||||||
# optionally specify --end, --keyfile, --ref and --user
|
# optionally specify --end, --keyfile, --ref and --user
|
||||||
DATE=`date --iso`
|
TIME=`date +%Y%m%d%H%M%S`
|
||||||
mv out $DATE
|
mv out $TIME
|
||||||
cat $DATE/*.csv | sort | uniq > $DATE/all.csv
|
cat $TIME/*.csv | sort | uniq > $TIME/all.csv
|
||||||
|
|
||||||
4) You can use diff.py to get the new ATCs since the previous run:
|
4) You can use diff.py to get the new ATCs since the previous run:
|
||||||
|
|
||||||
./diff.py $OLD-DATE/all.csv $DATE/all.csv $DATE/new.csv
|
./diff.py $OLD-TIME/all.csv $TIME/all.csv $TIME/new.csv
|
||||||
|
@ -109,10 +109,12 @@ def project_stats(project, output, begin, end, keyfile, user):
|
|||||||
|
|
||||||
done = False
|
done = False
|
||||||
last_sortkey = ''
|
last_sortkey = ''
|
||||||
start_date = datetime.datetime(int(begin[0:4]), int(begin[4:6]),
|
begin_time = datetime.datetime(
|
||||||
int(begin[6:8]), 0, 0, 0)
|
int(begin[0:4]), int(begin[4:6]), int(begin[6:8]),
|
||||||
end_date = datetime.datetime(int(end[0:4]), int(end[4:6]), int(end[6:8]),
|
int(begin[8:10]), int(begin[10:12]), int(begin[12:14]))
|
||||||
0, 0, 0)
|
end_time = datetime.datetime(
|
||||||
|
int(end[0:4]), int(end[4:6]), int(end[6:8]),
|
||||||
|
int(end[8:10]), int(end[10:12]), int(end[12:14]))
|
||||||
|
|
||||||
count = 0
|
count = 0
|
||||||
earliest = datetime.datetime.now()
|
earliest = datetime.datetime.now()
|
||||||
@ -138,7 +140,7 @@ def project_stats(project, output, begin, end, keyfile, user):
|
|||||||
if aprv['type'] != 'SUBM':
|
if aprv['type'] != 'SUBM':
|
||||||
continue
|
continue
|
||||||
ts = datetime.datetime.fromtimestamp(aprv['grantedOn'])
|
ts = datetime.datetime.fromtimestamp(aprv['grantedOn'])
|
||||||
if ts < start_date or ts > end_date:
|
if ts < begin_time or ts > end_time:
|
||||||
continue
|
continue
|
||||||
approved = True
|
approved = True
|
||||||
if ts < earliest:
|
if ts < earliest:
|
||||||
@ -177,14 +179,14 @@ def get_extra_atcs(url):
|
|||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
today = ''.join(
|
now = ''.join(
|
||||||
'%02d' % x for x in datetime.datetime.utcnow().utctimetuple()[:3])
|
'%02d' % x for x in datetime.datetime.utcnow().utctimetuple()[:6])
|
||||||
|
|
||||||
optparser = optparse.OptionParser()
|
optparser = optparse.OptionParser()
|
||||||
optparser.add_option(
|
optparser.add_option(
|
||||||
'-b', '--begin', help='begin date (e.g. 20131017)')
|
'-b', '--begin', help='begin date/time (e.g. 20131017000000)')
|
||||||
optparser.add_option(
|
optparser.add_option(
|
||||||
'-e', '--end', default=today, help='end date (default is today)')
|
'-e', '--end', default=now, help='end date/time (default is now)')
|
||||||
optparser.add_option(
|
optparser.add_option(
|
||||||
'-k', '--keyfile', default='~/.ssh/id_rsa',
|
'-k', '--keyfile', default='~/.ssh/id_rsa',
|
||||||
help='SSH key (default is ~/.ssh/id_rsa)')
|
help='SSH key (default is ~/.ssh/id_rsa)')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user