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, 'groceries.api.GrocyAPIClient', 'groceries.GrocyAPIClient', True, 'import groceries.api as groceries\n'), (17, 'logging.basicConfig', 'logging.basicConfig', False, 'import logging\n'), (9, 'barcodescanner.scan.Scan', 'barcode.Scan', True, 'import barcodescanner.scan as barcode\n'), (13, 'logging.debug', 'logging.debug', False, 'import logging\n')]