Commit 3f908459 authored by 李康's avatar 李康

support starting brand sub-type

parent 9b1d700d
......@@ -292,6 +292,10 @@ def getProductByType(argv):
if not os.path.exists(brand_name):
os.makedirs(brand_name)
starting_brand_name = None
if len(argv) == 3:
starting_brand_name = argv[2]
d = u2.connect_usb('d52196830204')
print(d.app_current())
d.freeze_rotation()
......@@ -305,7 +309,19 @@ def getProductByType(argv):
scraped_cnt = 0
with open(brand_name+"/products.csv", 'a+') as f:
ftype_names = getAllFilterTypes(d)
temp_types = getAllFilterTypes(d)
ftype_names = []
if starting_brand_name is not None:
starting_flag = False
for temp_type in temp_types:
if starting_flag:
ftype_names.append(temp_type)
elif temp_type == starting_brand_name:
ftype_names.append(temp_type)
starting_flag = True
else:
ftype_names = temp_types
print("All the brand sub-types:")
for ftype_name in ftype_names:
print(ftype_name)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment