Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commiteede4fa

Browse files
author
Mark Costello
committed
Changes to reporting - pass in a start and end date in datetime format
1 parent475b185 commiteede4fa

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

‎zencoder/core.py

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
importos
22
importhttplib2
33
fromurllibimporturlencode
4+
fromdatetimeimportdatetime
45

56
# Note: I've seen this pattern for dealing with json in different versions of
67
# python in a lot of modules -- if there's a better way, I'd love to use it.
@@ -372,21 +373,28 @@ def delete(self, job_id):
372373
classReport(HTTPBackend):
373374
def__init__(self,*args,**kwargs):
374375
"""
375-
Contains all API methods relating toOutputs.
376+
Contains all API methods relating toReports.
376377
"""
377378
kwargs['resource_name']='reports'
378379
super(Report,self).__init__(*args,**kwargs)
379380

380-
defdetails(self,start_date=None,end_date=None,grouping=None):
381+
defminutes(self,start_date=None,end_date=None,grouping=None):
381382
"""
382-
Gets a detailed Report
383+
Gets a detailed Report of encoded minutes and billable minutes
384+
for a date range
385+
@param start_date: Start date of report (If not submitted,
386+
API defaults to 30 days ago)
387+
@param end_date: End date of report (If not submitted, API defaults to
388+
yesterday)
389+
@param grouping: Minute usage for only one report grouping
383390
"""
384391
data= {'api_key':self.api_key}
392+
date_format='%Y-%m-%d'
385393
ifstart_date:
386-
data['from']=start_date
394+
data['from']=datetime.strftime(start_date,date_format).date()
387395

388396
ifend_date:
389-
data['to']=end_date
397+
data['to']=datetime.strftime(end_date,date_format).date()
390398

391399
ifgrouping:
392400
data['grouping']=grouping

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp