<commit_before>from __future__ import division
from common import *

from secret_settings import OBFUSCATION_KEY, AWS_ACCESS_KEY_ID, AWS_SECRET_KEY

DEV_BOX = True

EARLY_BADGE_PRICE = 40
LATE_BADGE_PRICE  = 45
DOOR_BADGE_PRICE  = 60

EARLY_GROUP_PRICE = 30
LATE_GROUP_PRICE  = 35

class State:
    SEND_EMAILS = True
    AUTO_EMAILS = True
    
    AT_THE_CON = False
    POST_CON = False
    UBER_SHUT_DOWN = False
    HIDE_SCHEDULE = True
    
    PREREG_CLOSED = False
    PREREG_NOT_OPEN_YET = True
    SUP_REG_OPEN = False
    GROUP_REG_OPEN = True
    DEALER_WAITLIST_CLOSED = True
    ETCHED_BADGES_ORDERED = False
    
    STAFFERS_IMPORTED    = datetime(2012,  5, 29)
    SHIFTS_CREATED       = datetime(2012, 11,  3)
    PRICE_BUMP           = datetime(2012, 11,  4, 23, 59)
    DEALER_REG_START     = datetime(2012,  7, 27, 11, 59)
    DEALER_REG_SHUTDOWN  = datetime(2012, 11, 19, 11, 59)
    DEALER_REG_DEADLINE  = datetime(2012,  9,  3, 11, 59)
    DEALER_PAYMENT_DUE   = datetime(2012, 11, 30, 23, 59)
    ROOM_DEADLINE        = datetime(2012, 12,  1, 23, 59)
    STAFF_BADGE_DEADLINE = datetime(2012, 12,  9, 23, 59)
    PREREG_TAKEDOWN      = datetime(2012, 12, 26, 11, 59)
    UBER_TAKEDOWN        = datetime(2013, 12, 30, 23, 59)
    EPOCH                = datetime(2013,  1,  3,  8)
    ESCHATON             = datetime(2013,  1,  6, 22)
    
    PATH     = "/magfest"
    HOSTNAME = "magfestubersystem.com"
    
    @property
    def URL_BASE(self):
        return "http://" + self.HOSTNAME + self.PATH
    
    @property
    def DEALER_REG_OPEN(self):
        return self.DEALER_REG_START < datetime.now() < self.DEALER_REG_SHUTDOWN
    
    @property
    def BADGE_PRICE(self):
        if datetime.now() < self.PRICE_BUMP:
            return EARLY_BADGE_PRICE
        elif state.AT_THE_CON:
            return DOOR_BADGE_PRICE
        else:
            return LATE_BADGE_PRICE
    
    @property
    def GROUP_PRICE(self):
        if datetime.now() < state.PRICE_BUMP:
            return EARLY_GROUP_PRICE
        else:
            return LATE_GROUP_PRICE
    
    @property
    def PREREG_BADGE_TYPES(self):
        types = [ATTENDEE_BADGE]
        for reg_open,badge_type in [(self.SUP_REG_OPEN,    SUPPORTER_BADGE),
                                    (self.DEALER_REG_OPEN, PSEUDO_DEALER_BADGE),
                                    (self.GROUP_REG_OPEN,  PSEUDO_GROUP_BADGE)]:
            if reg_open:
                types.append(badge_type)
        return types
    
    @property
    def SHIFTS_AVAILABLE(self):
        return datetime.now() > self.SHIFTS_CREATED
    
    @property
    def ROOMS_AVAILABLE(self):
        return datetime.now() < state.ROOM_DEADLINE
    
    @property
    def DEALER_REG_FULL(self):
        return datetime.now() > self.DEALER_REG_DEADLINE
    
    @property
    def CUSTOM_BADGES_ORDERED(self):
        return datetime.now() > self.STAFF_BADGE_DEADLINE

state = State()

SUPPORTER_BADGE_PRICE = 100
ONEDAY_BADGE_PRICE    = 35
DEALER_BADGE_PRICE    = 30
TABLE_PRICES          = "$120 for the first table, $160 for the second table, $200 for each additional table"

ADMIN_EMAIL = "<NAME> <<EMAIL>>"
REGDESK_EMAIL = "<NAME> <<EMAIL>>"
STAFF_EMAIL = "<NAME> <<EMAIL>>"
MARKETPLACE_EMAIL = "<NAME> <<EMAIL>>"
REG_EMAILS = [ADMIN_EMAIL]
PAYMENT_BCC = [ADMIN_EMAIL]

CONSENT_FORM_URL  = state.URL_BASE + "/static/MinorConsentForm.pdf"

PAYPAL_RETURN_URL = "http://magfest.org/prereg-complete"
if DEV_BOX:
    PAYPAL_ACTION = "https://www.sandbox.paypal.com/cgi-bin/webscr"
else:
    REG_EMAILS += ["<EMAIL>"]
    PAYPAL_ACTION = "https://www.paypal.com/cgi-bin/webscr"

REGDESK_EMAIL_SIGNATURE = """\
 - Victoria Earl,
MAGFest Registration Chair"""

STOPS_EMAIL_SIGNATURE = """\
 - <NAME>,
MAGFest Staffing Coordinator"""

MARKETPLACE_EMAIL_SIGNATURE = """\
 - <NAME>,
MAGFest Marketplace Coordinator"""

CON_LENGTH      = (state.ESCHATON - state.EPOCH).days * 24 + (state.ESCHATON - state.EPOCH).seconds // 3600
START_TIME_OPTS = [(dt, dt.strftime("%I %p %a")) for dt in (state.EPOCH + timedelta(hours = i) for i in range(CON_LENGTH))]
DURATION_OPTS   = [(i, "%i hour%s"%(i,("s" if i > 1 else ""))) for i in range(1,8)]
EVENT_START_TIME_OPTS = [(dt, dt.strftime("%I %p %a") if not dt.minute else dt.strftime("%I:%M %a"))
                         for dt in [state.EPOCH + timedelta(minutes = i * 30) for i in range(2 * CON_LENGTH)]]
EVENT_DURATION_OPTS = [(i, "%.1f hour%s" % (i/2, "s" if i != 2 else "")) for i in range(1, 19)]

EVENT_LOC_OPTS = (
    (0,  "Panels 1"),
    (1,  "Panels 2"),
    (2,  "Panels 3"),
    (8,  "Panels 4"),
    (9,  "Panels 5"),
    (13, "Panels 6"),
    (10, "Autographs"),
    (3,  "Console 1"),
    (14, "Console 2"),
    (15, "Console 3"),
    (4,  "Arcade"),
    (5,  "Games on Film"),
    (6,  "Tabletop (Tournaments)"),
    (11, "Tabletop (Free Play)"),
    (12, "Tabletop (CCG)"),
    (7,  "Music"),
)
EVENT_LOCS = [loc for loc,desc in EVENT_LOC_OPTS]
EVENT_BOOKED = {"colspan": 0}
EVENT_OPEN   = {"colspan": 1}

BADGE_LOCK = RLock()

ATTENDEE_BADGE  = 0
STAFF_BADGE     = 1<commit_msg>added chiptunes to schedule<commit_after>from __future__ import division
from common import *

from secret_settings import OBFUSCATION_KEY, AWS_ACCESS_KEY_ID, AWS_SECRET_KEY

DEV_BOX = True

EARLY_BADGE_PRICE = 40
LATE_BADGE_PRICE  = 45
DOOR_BADGE_PRICE  = 60

EARLY_GROUP_PRICE = 30
LATE_GROUP_PRICE  = 35

class State:
    SEND_EMAILS = True
    AUTO_EMAILS = True
    
    AT_THE_CON = False
    POST_CON = False
    UBER_SHUT_DOWN = False
    HIDE_SCHEDULE = True
    
    PREREG_CLOSED = False
    PREREG_NOT_OPEN_YET = True
    SUP_REG_OPEN = False
    GROUP_REG_OPEN = True
    DEALER_WAITLIST_CLOSED = True
    ETCHED_BADGES_ORDERED = False
    
    STAFFERS_IMPORTED    = datetime(2012,  5, 29)
    SHIFTS_CREATED       = datetime(2012, 11,  3)
    PRICE_BUMP           = datetime(2012, 11,  4, 23, 59)
    DEALER_REG_START     = datetime(2012,  7, 27, 11, 59)
    DEALER_REG_SHUTDOWN  = datetime(2012, 11, 19, 11, 59)
    DEALER_REG_DEADLINE  = datetime(2012,  9,  3, 11, 59)
    DEALER_PAYMENT_DUE   = datetime(2012, 11, 30, 23, 59)
    ROOM_DEADLINE        = datetime(2012, 12,  1, 23, 59)
    STAFF_BADGE_DEADLINE = datetime(2012, 12,  9, 23, 59)
    PREREG_TAKEDOWN      = datetime(2012, 12, 26, 11, 59)
    UBER_TAKEDOWN        = datetime(2013, 12, 30, 23, 59)
    EPOCH                = datetime(2013,  1,  3,  8)
    ESCHATON             = datetime(2013,  1,  6, 22)
    
    PATH     = "/magfest"
    HOSTNAME = "magfestubersystem.com"
    
    @property
    def URL_BASE(self):
        return "http://" + self.HOSTNAME + self.PATH
    
    @property
    def DEALER_REG_OPEN(self):
        return self.DEALER_REG_START < datetime.now() < self.DEALER_REG_SHUTDOWN
    
    @property
    def BADGE_PRICE(self):
        if datetime.now() < self.PRICE_BUMP:
            return EARLY_BADGE_PRICE
        elif state.AT_THE_CON:
            return DOOR_BADGE_PRICE
        else:
            return LATE_BADGE_PRICE
    
    @property
    def GROUP_PRICE(self):
        if datetime.now() < state.PRICE_BUMP:
            return EARLY_GROUP_PRICE
        else:
            return LATE_GROUP_PRICE
    
    @property
    def PREREG_BADGE_TYPES(self):
        types = [ATTENDEE_BADGE]
        for reg_open,badge_type in [(self.SUP_REG_OPEN,    SUPPORTER_BADGE),
                                    (self.DEALER_REG_OPEN, PSEUDO_DEALER_BADGE),
                                    (self.GROUP_REG_OPEN,  PSEUDO_GROUP_BADGE)]:
            if reg_open:
                types.append(badge_type)
        return types
    
    @property
    def SHIFTS_AVAILABLE(self):
        return datetime.now() > self.SHIFTS_CREATED
    
    @property
    def ROOMS_AVAILABLE(self):
        return datetime.now() < state.ROOM_DEADLINE
    
    @property
    def DEALER_REG_FULL(self):
        return datetime.now() > self.DEALER_REG_DEADLINE
    
    @property
    def CUSTOM_BADGES_ORDERED(self):
        return datetime.now() > self.STAFF_BADGE_DEADLINE

state = State()

SUPPORTER_BADGE_PRICE = 100
ONEDAY_BADGE_PRICE    = 35
DEALER_BADGE_PRICE    = 30
TABLE_PRICES          = "$120 for the first table, $160 for the second table, $200 for each additional table"

ADMIN_EMAIL = "<NAME> <<EMAIL>>"
REGDESK_EMAIL = "<NAME> <<EMAIL>>"
STAFF_EMAIL = "<NAME> <<EMAIL>>"
MARKETPLACE_EMAIL = "<NAME> <<EMAIL>>"
REG_EMAILS = [ADMIN_EMAIL]
PAYMENT_BCC = [ADMIN_EMAIL]

CONSENT_FORM_URL  = state.URL_BASE + "/static/MinorConsentForm.pdf"

PAYPAL_RETURN_URL = "http://magfest.org/prereg-complete"
if DEV_BOX:
    PAYPAL_ACTION = "https://www.sandbox.paypal.com/cgi-bin/webscr"
else:
    REG_EMAILS += ["<EMAIL>"]
    PAYPAL_ACTION = "https://www.paypal.com/cgi-bin/webscr"

REGDESK_EMAIL_SIGNATURE = """\
 - V<NAME>,
MAGFest Registration Chair"""

STOPS_EMAIL_SIGNATURE = """\
 - <NAME>,
MAGFest Staffing Coordinator"""

MARKETPLACE_EMAIL_SIGNATURE = """\
 - <NAME>,
MAGFest Marketplace Coordinator"""

CON_LENGTH      = (state.ESCHATON - state.EPOCH).days * 24 + (state.ESCHATON - state.EPOCH).seconds // 3600
START_TIME_OPTS = [(dt, dt.strftime("%I %p %a")) for dt in (state.EPOCH + timedelta(hours = i) for i in range(CON_LENGTH))]
DURATION_OPTS   = [(i, "%i hour%s"%(i,("s" if i > 1 else ""))) for i in range(1,8)]
EVENT_START_TIME_OPTS = [(dt, dt.strftime("%I %p %a") if not dt.minute else dt.strftime("%I:%M %a"))
                         for dt in [state.EPOCH + timedelta(minutes = i * 30) for i in range(2 * CON_LENGTH)]]
EVENT_DURATION_OPTS = [(i, "%.1f hour%s" % (i/2, "s" if i != 2 else "")) for i in range(1, 19)]

EVENT_LOC_OPTS = (
    (0,  "Panels 1"),
    (1,  "Panels 2"),
    (2,  "Panels 3"),
    (8,  "Panels 4"),
    (9,  "Panels 5"),
    (13, "Panels 6"),
    (10, "Autographs"),
    (3,  "Console 1"),
    (14, "Console 2"),
    (15, "Console 3"),
    (4,  "Arcade"),
    (5,  "Games on Film"),
    (6,  "Tabletop (Tournaments)"),
    (11, "Tabletop (Free Play)"),
    (12, "Tabletop (CCG)"),
    (7,  "Concerts"),
    (17, "Chiptunes"),
)
EVENT_LOCS = [loc for loc,desc in EVENT_LOC_OPTS]
EVENT_BOOKED = {"colspan": 0}
EVENT_OPEN   = {"colspan": 1}

BADGE_LOCK = RLock()

ATTENDEE_BADGE  = 0
STAFF_BADGE     = 1
{'fraction_non_alphanumeric': 0.12259709690074538, 'fraction_numerical': 0.041388779913691644, 'mean_word_length': 2.717462632154575, 'pattern_counts': {'":': 4, '<': 44, '<?xml version=': 0, '>': 42, 'https://': 4, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7503646', 'n_tokens_mistral': 4354, 'n_tokens_neox': 3970, 'n_words': 839}