Skip to content

Instantly share code, notes, and snippets.

@stdavis
Last active June 26, 2017 21:21
Show Gist options
  • Select an option

  • Save stdavis/aba2ecd009f26e0dbb5cbc1ea9445488 to your computer and use it in GitHub Desktop.

Select an option

Save stdavis/aba2ecd009f26e0dbb5cbc1ea9445488 to your computer and use it in GitHub Desktop.
Pallet Ship Shell
'''
NamePallet.py
A module that ...
'''
from forklift.models import Pallet
from time import strftime
class NamePallet(Pallet):
def is_ready_to_ship(self):
run_day = 'Monday'
ready = strftime('%A') == run_day
if not ready:
self.success = (True, 'This pallet only runs on {}s.'.format(run_day))
return ready
def ship(self):
#: your code goes here
#: replace print statements with self.log.info('...')
if __name__ == '__main__':
import logging
pallet = NamePallet()
logging.basicConfig(
format='%(levelname)s %(asctime)s %(lineno)s %(message)s',
datefmt='%H:%M:%S',
level=logging.INFO
)
pallet.log = logging
pallet.ship()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment