Ejemplo n.º 1
0
def remove_collects ( tree,old_collects,log,pas,domen ):
 m=0
 for n in old_collects:
  cl= find_collects_by_p_and_c ( tree,n[0],n[1] )
#  print cl
  rez = api_set.remove_collect ( cl.encode('utf8'),log,pas,domen )
  if rez:
   m=m+1
 return m
Ejemplo n.º 2
0
   api_set.post_product_in_collection ( prod_id,id,log,pas,domen )  
   print " not in"
  remove_product_from_products ( prods_tree, prod_id )
 print id
 kroshki (collections_tree,collects_tree,id,prod_id,log,pas,domen)
 id=parent
# print "_________________"
# if i>15:
#  break

prods=prods_tree.getroot().findall("product")
for i in range(0,len(prods)-1):
 prod_id=prods[i].find("id").text 
 colls= find_collects_by_product ( collects_tree,prod_id,spec )

 if colls==None:
#  print " no collects"
  continue 
 for col in colls:
#  print "delete"
#  print prod_id
#  print col 
#  print "___________________"
  if col!=spec :
   api_set.remove_collect (col,log,pas,domen)
  else:
    print spec
# if i> 11:
#  break
#find_dublicates_in_products(prods_tree)