mirror of
https://github.com/c0de-archive/ebay-testing.git
synced 2025-08-06 23:18:45 +00:00
Add range selection ability
The original implementation could only search for items that end in a specific date range This makes it so that we can select between a start range, modified range, or the default end range The override could probably use some work as there is currently nothing checking sellerList for any other types and there can only be one
This commit is contained in:
15
ebay.py
15
ebay.py
@@ -247,8 +247,23 @@ def glue(api, sellerList, dateRange={}):
|
||||
|
||||
# Override the dates in sellerList with values from dateRange, if provided
|
||||
if ('from' in dateRange) & ('type' in dateRange):
|
||||
# Remove the list of keys from sellerList - We can only have one search range
|
||||
for o in ['EndTimeFrom','ModTimeFrom','StartTimeFrom']:
|
||||
try:
|
||||
del sellerList[o]
|
||||
except KeyError:
|
||||
continue
|
||||
|
||||
sellerList[rangeType(dateRange['type'])+'TimeFrom'] = dateRange['from']
|
||||
|
||||
if ('to' in dateRange) & ('type' in dateRange):
|
||||
# Remove the list of keys from sellerList - We can only have one search range
|
||||
for o in ['EndTimeTo','ModTimeTo','StartTimeTo']:
|
||||
try:
|
||||
del sellerList[o]
|
||||
except KeyError:
|
||||
continue
|
||||
|
||||
sellerList[rangeType(dateRange['type'])+'TimeTo'] = dateRange['to']
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user