import logging
import groceries.api as groceries
import barcodescanner.scan as barcode


def main():
    grocy = groceries.GrocyAPIClient()
    while True:
        scanner = barcode.Scan()
        line = scanner.PollScanner()
        if line != None:
            response = grocy.consume_barcode(line)
            logging.debug(response)


if __name__ == "__main__":
    logging.basicConfig(level=logging.DEBUG)
    main()

[((7, 12, 7, 38), 'groceries.api.GrocyAPIClient', 'groceries.GrocyAPIClient', ({}, {}), '()', True, 'import groceries.api as groceries\n'), ((17, 4, 17, 44), 'logging.basicConfig', 'logging.basicConfig', (), '', False, 'import logging\n'), ((9, 18, 9, 32), 'barcodescanner.scan.Scan', 'barcode.Scan', ({}, {}), '()', True, 'import barcodescanner.scan as barcode\n'), ((13, 12, 13, 35), 'logging.debug', 'logging.debug', ({(13, 26, 13, 34): 'response'}, {}), '(response)', False, 'import logging\n')]