<commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-

from FoodScan.Shops.kaufland import *
from FoodScan.antiCaptcha import AntiCaptcha
from FoodScan.barcode import Barcode
from FoodScan.bring import Bring
from FoodScan.codecheck import *
from FoodScan.wunderlist import *

from config import *

b = Bring(bring_user_uuid, bring_api_key, bring_authorization, bring_cookie)
cc = CodeCheck()
kl = Kaufland(kaufland_email, kaufland_password, AntiCaptcha(anti_captcha_key))
# ayn = AllYouNeed(all_you_need_email, all_you_need_password)

l = WuList(kl, cc, b, wunderlist_client_id, wunderlist_token, shopping_wunderlist_list_id, bring_export_list_id)
bc = Barcode(barcode_device, l.add_barcode)

l.add_barcode("4011800523213")

wait = [10, 30, 60, 120, 240, 480]
wait_index = 0
while True:
    change = l.sync_shop_list()
    if change:
        wait_index = 0
    else:
        time.sleep(wait[wait_index])
        wait_index = min(wait_index + 1, len(wait) - 1)
<commit_msg>fix barcode test<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-

from FoodScan.Shops.kaufland import *
from FoodScan.antiCaptcha import AntiCaptcha
from FoodScan.barcode import Barcode
from FoodScan.bring import Bring
from FoodScan.codecheck import *
from FoodScan.wunderlist import *

from config import *

b = Bring(bring_user_uuid, bring_api_key, bring_authorization, bring_cookie)
cc = CodeCheck()
kl = Kaufland(kaufland_email, kaufland_password, AntiCaptcha(anti_captcha_key))
# ayn = AllYouNeed(all_you_need_email, all_you_need_password)

l = WuList(kl, cc, b, wunderlist_client_id, wunderlist_token, shopping_wunderlist_list_id, bring_export_list_id)
bc = Barcode(barcode_device, l.add_barcode)

wait = [10, 30, 60, 120, 240, 480]
wait_index = 0
while True:
    change = l.sync_shop_list()
    if change:
        wait_index = 0
    else:
        time.sleep(wait[wait_index])
        wait_index = min(wait_index + 1, len(wait) - 1)

{'fraction_non_alphanumeric': 0.09901503369621566, 'fraction_numerical': 0.027475375842405392, 'mean_word_length': 4.9937888198757765, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4947313', 'n_tokens_mistral': 747, 'n_tokens_neox': 698, 'n_words': 157}