@@ -14,18 +14,18 @@ def sample():
1414def main (opts ):
1515
1616 with file_lock ("/tmp/.ebaysdk-poller-orders.lock" ):
17- log .debug ("worker" )
17+ log .debug ("Started poller %s" % __file__ )
1818
19- to_time = datetime .utcnow ()
20- from_time = to_time - timedelta (days = 1 )
19+ to_time = datetime .utcnow () - timedelta ( days = 10 )
20+ from_time = to_time - timedelta (days = 29 )
2121
2222 ebay_api = Trading (debug = opts .debug , config_file = opts .yaml , appid = opts .appid ,
2323 certid = opts .certid , devid = opts .devid , siteid = opts .siteid , warnings = False
2424 )
2525
2626 resp = ebay_api .execute ('GetOrders' , {
2727 'DetailLevel' : 'ReturnAll' ,
28- 'OrderStatus' : 'Completed' ,
28+ # 'OrderStatus': 'Completed',
2929 'Pagination' : {
3030 'EntriesPerPage' : 25 ,
3131 'PageNumber' : 1 ,
@@ -34,21 +34,24 @@ def main(opts):
3434 'ModTimeTo' : to_time .strftime ('%Y-%m-%dT%H:%M:%S.000Z' ),
3535 })
3636
37- #from IPython import embed; embed()
3837
39- for order in resp .reply .OrderArray .Order :
38+ if resp .reply .OrderArray :
39+ for order in resp .reply .OrderArray .Order :
4040
41- log .debug ("ID: %s" % order .OrderID )
42- log .debug ("Status: %s" % order .OrderStatus )
43- log .debug ("Seller Email: %s" % order .SellerEmail )
44- log .debug ("Title: %s" % order .TransactionArray .Transaction .Item .Title )
45- log .debug ("ItemID: %s" % order .TransactionArray .Transaction .Item .ItemID )
46- log .debug ("SKU: %s" % order .TransactionArray .Transaction .Variation .SKU )
41+ log .debug ("ID: %s" % order .OrderID )
42+ log .debug ("Status: %s" % order .OrderStatus )
43+ log .debug ("Seller Email: %s" % order .SellerEmail )
44+ log .debug ("Title: %s" % order .TransactionArray .Transaction .Item .Title )
45+ log .debug ("ItemID: %s" % order .TransactionArray .Transaction .Item .ItemID )
46+ log .debug ("SKU: %s" % order .TransactionArray .Transaction .Variation .SKU )
47+
48+ if order .ShippingDetails .get ('ShipmentTrackingDetails' , None ):
49+ log .debug ("Tracking: %s" % order .ShippingDetails .ShipmentTrackingDetails .ShipmentTrackingNumber )
50+ log .debug ("Carrier: %s" % order .ShippingDetails .ShipmentTrackingDetails .ShippingCarrierUsed )
51+ log .debug ("Cost: %s" % order .ShippingDetails .ShippingServiceOptions .ShippingServiceCost )
52+ else :
53+ log .debug ("no orders to process" )
4754
48- if order .ShippingDetails .get ('ShipmentTrackingDetails' , None ):
49- log .debug ("Tracking: %s" % order .ShippingDetails .ShipmentTrackingDetails .ShipmentTrackingNumber )
50- log .debug ("Carrier: %s" % order .ShippingDetails .ShipmentTrackingDetails .ShippingCarrierUsed )
51- log .debug ("Cost: %s" % order .ShippingDetails .ShippingServiceOptions .ShippingServiceCost )
5255 '''
5356 - item title .. Title
5457 - ebay auction Id .. ItemID
0 commit comments