Skip to content

Commit

Permalink
Separate main function
Browse files Browse the repository at this point in the history
  • Loading branch information
tychxn committed Jul 12, 2018
1 parent 16d34f8 commit 01869cb
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 15 deletions.
15 changes: 0 additions & 15 deletions jd_assistant.py
Original file line number Diff line number Diff line change
Expand Up @@ -542,18 +542,3 @@ def get_order_info(self, unpaid=True):
print(get_current_time(), '订单查询为空')
except Exception as e:
print(get_current_time(), e)


if __name__ == '__main__':
asst = Assistant()
asst.login_by_username()
# asst.login_by_QRcode()
print(asst.get_item_stock_state(sku_id='5089267', area='12_904_3375'))
print(asst.get_item_price(sku_id='5089267'))
asst.clear_cart()
asst.add_item_to_cart(sku_id='5089267')
asst.get_cart_detail()
asst.get_checkout_page_detail()
print(asst.get_user_info())
# asst.submit_order()
asst.get_order_info(unpaid=False)
17 changes: 17 additions & 0 deletions main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/env python
# -*- coding:utf-8 -*-
from jd_assistant import Assistant

if __name__ == '__main__':
asst = Assistant()
asst.login_by_username()
# asst.login_by_QRcode()
print(asst.get_item_stock_state(sku_id='5089267', area='12_904_3375'))
print(asst.get_item_price(sku_id='5089267'))
asst.clear_cart()
asst.add_item_to_cart(sku_id='5089267')
asst.get_cart_detail()
asst.get_checkout_page_detail()
print(asst.get_user_info())
# asst.submit_order()
asst.get_order_info(unpaid=False)

0 comments on commit 01869cb

Please sign in to comment.