Skip to content

Commit

Permalink
Merge pull request #82 from andela-kanyanwu/38__envvar_for_weekly_men…
Browse files Browse the repository at this point in the history
…u_fallback_code

Update code for checking week
  • Loading branch information
kosyfrances committed Apr 19, 2016
2 parents e729371 + cc37574 commit 360ecd3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions plugins/food_bot_plugin.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import sys
import datetime
from mako.template import Template
from custom_sql import CustomSQL
Expand Down Expand Up @@ -63,16 +62,17 @@ def get_week_number():

week = (datetime.datetime.now().isocalendar()[1] % 2)
config_week = config['FB__WEEK']
print config_week
sys.stdout.flush()

if config_week == 'A':
if week == 0:
week = 2
else:
return week

# fall back code here when the week switches
if config_week == 'B':
# WEEK is 0
week += 1

return week

@staticmethod
Expand Down

0 comments on commit 360ecd3

Please sign in to comment.