Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from bokchoy.chain import Chain, Step
- from bokchoy import (
- consumers as bokchoy_consumers,
- parsers as bokchoy_parsers
- )
- from tofu import (
- sources as tofu_sources,
- consumers as tofu_consumers
- )
- logfile = '/data/shared/cron_logs/20180614_ams_coupons.log' # change logfile name
- import logging;logging.basicConfig(
- filename=logfile,
- level=logging.DEBUG,
- format=' '.join([
- '[%(asctime)s]',
- '[%(process)d]',
- '[%(name)s]',
- '[%(levelname)s]',
- '%(message)s']),
- )
- ### RUN COUPON CHAIN###
- ams_coupons_chain = Chain(name='coupons_chain', steps=[
- Step(
- name='ams_offers',
- source=tofu_sources.AmsOffersSource(),
- parser=bokchoy_parsers.IdentityParser(),
- consumer=bokchoy_consumers.OffersConsumer()
- ),
- Step(
- name='ams_offer_images',
- source=tofu_sources.OfferImagesFTPSource(),
- parser=bokchoy_parsers.IdentityParser(),
- consumer=tofu_consumers.AMSOfferImagesConsumer()
- )
- ])
- ams_coupons_chain()
Add Comment
Please, Sign In to add comment