コード例 #1
0
def getHolidayConfigDatesDict(configDefs):
    defaultDates = HolidayDates(HolidayDates.TYPE_CUSTOM, [])
    return getHolidayConfigAttrDict(configDefs,
                                    attrName='dates',
                                    defaultValue=defaultDates)
コード例 #2
0
    CAT9 = 9
    CAT10 = 10
    CAT11 = 11
    CAT12 = 12
    CAT13 = 13
    CAT14 = 14
    Outfit_3 = 97
    Outfit_2 = 98
    Outfit_1 = 99

CatalogHolidayConfigs = {
    ConfigIds.CAT1: {
        'id': ConfigIds.CAT1,
        'name': 'CAT1',
        'dates': HolidayDates(HolidayDates.TYPE_YEARLY, [
            (Month.NOVEMBER, 1, 0, 0, 0),
            (Month.DECEMBER, 31, 23, 59, 0)]) },
    ConfigIds.CAT2: {
        'id': ConfigIds.CAT2,
        'name': 'CAT2',
        'dates': HolidayDates(HolidayDates.TYPE_YEARLY, [
            (Month.DECEMBER, 1, 0, 0, 0),
            (Month.DECEMBER, 31, 23, 59, 0),
            (Month.JANUARY, 1, 0, 0, 0),
            (Month.JANUARY, 31, 23, 59, 0)]) },
    ConfigIds.CAT3: {
        'id': ConfigIds.CAT3,
        'name': 'CAT3',
        'dates': HolidayDates(HolidayDates.TYPE_YEARLY, [
            (Month.JANUARY, 1, 0, 0, 0),
            (Month.FEBRUARY, 28, 23, 59, 0)]) },
コード例 #3
0
                    continue

        if entry.lower() == holidayName:
            return getHolidayId(holidayClass, None)
            continue


def getHolidayClassName(holidayClass):
    return holidayClassNameDict.get(holidayClass,
                                    holidayNameDict.get(holidayClass))


holidaySchedules = {
    DOUBLEGOLDHOLIDAY:
    HolidayDates(HolidayDates.TYPE_CUSTOM,
                 [(2008, Month.SEPTEMBER, 13, 12, 0, 0),
                  (2008, Month.SEPTEMBER, 13, 15, 0, 0)]),
    DOUBLEGOLDHOLIDAYPAID:
    HolidayDates(HolidayDates.TYPE_CUSTOM,
                 [(2008, Month.SEPTEMBER, 14, 12, 0, 0),
                  (2008, Month.SEPTEMBER, 14, 15, 0, 0)]),
    DOUBLEXPHOLIDAY:
    HolidayDates(HolidayDates.TYPE_CUSTOM,
                 [(2009, Month.DECEMBER, 19, 12, 0, 0),
                  (2009, Month.DECEMBER, 19, 15, 0, 0)]),
    DOUBLEXPHOLIDAYPAID:
    HolidayDates(HolidayDates.TYPE_CUSTOM,
                 [(2009, Month.DECEMBER, 20, 12, 0, 0),
                  (2009, Month.DECEMBER, 20, 15, 0, 0)]),
    FREEHATWEEK:
    HolidayDates(HolidayDates.TYPE_CUSTOM,
コード例 #4
0
# File: M (Python 2.4)

from pirates.ai.HolidayDates import *


class ConfigIds:
    CrewDays = 1


MessageHolidayConfigs = {
    ConfigIds.CrewDays: {
        'id':
        ConfigIds.CrewDays,
        'name':
        'CrewDays (Msg)',
        'dates':
        HolidayDates(HolidayDates.TYPE_WEEKLY, [(Day.FRIDAY, 15, 0, 0),
                                                (Day.FRIDAY, 20, 0, 0),
                                                (Day.SATURDAY, 15, 0, 0),
                                                (Day.SATURDAY, 20, 0, 0)])
    }
}
コード例 #5
0
            for holidayConfig in entry.iterkeys():
                if entry.get(holidayConfig).lower() == holidayName:
                    return getHolidayId(holidayClass, holidayConfig)

        elif entry.lower() == holidayName:
            return getHolidayId(holidayClass, None)

    return None


def getHolidayClassName(holidayClass):
    return holidayClassNameDict.get(holidayClass, holidayNameDict.get(holidayClass))


holidaySchedules = {
  DOUBLEGOLDHOLIDAY: HolidayDates(HolidayDates.TYPE_CUSTOM, [
    (2008, Month.SEPTEMBER, 13, 12, 0, 0), (2008, Month.SEPTEMBER, 13, 15, 0, 0)]),
  DOUBLEGOLDHOLIDAYPAID: HolidayDates(HolidayDates.TYPE_CUSTOM, [
    (2008, Month.SEPTEMBER, 14, 12, 0, 0), (2008, Month.SEPTEMBER, 14, 15, 0, 0)]),
  DOUBLEXPHOLIDAY: HolidayDates(HolidayDates.TYPE_CUSTOM, [
    (2009, Month.DECEMBER, 19, 12, 0, 0), (2009, Month.DECEMBER, 19, 15, 0, 0)]),
  DOUBLEXPHOLIDAYPAID: HolidayDates(HolidayDates.TYPE_CUSTOM, [
    (2009, Month.SEPTEMBER, 20, 12, 0, 0), (2009, Month.DECEMBER, 20, 15, 0, 0)]),
  DOUBLELOOTHOLIDAY: HolidayDates(HolidayDates.TYPE_CUSTOM, [
    (2008, Month.SEPTEMBER, 13, 12, 0, 0), (2008, Month.SEPTEMBER, 13, 15, 0, 0)]),
  FREEHATWEEK: HolidayDates(HolidayDates.TYPE_CUSTOM, [
    (2008, Month.FEBRUARY, 25, 0, 0, 0), (2008, Month.MARCH, 2, 0, 0, 0)]),
  SAINTPATRICKSDAY: HolidayDates(HolidayDates.TYPE_YEARLY, [
    (Month.MARCH, 2, 0, 0, 0), (Month.MARCH, 29, 0, 0, 0)]),
  APRILFOOLS: HolidayDates(HolidayDates.TYPE_YEARLY, [
    (Month.APRIL, 1, 0, 0, 0), (Month.APRIL, 2, 12, 0, 0)]),
  MOTHERSDAY: HolidayDates(HolidayDates.TYPE_YEARLY, [
コード例 #6
0
from pirates.ai.HolidayDates import *

class ConfigIds():
    CrewDays = 1

MessageHolidayConfigs = {
    ConfigIds.CrewDays: {
        'id': ConfigIds.CrewDays,'name': 'CrewDays (Msg)','dates': HolidayDates(HolidayDates.TYPE_WEEKLY, [
            (Day.FRIDAY, 15, 0, 0), 
            (Day.FRIDAY, 20, 0, 0), 
            (Day.SATURDAY, 15, 0, 0), 
            (Day.SATURDAY, 20, 0, 0)])
        }
   }
コード例 #7
0
    CAT14 = 14
    CAT15 = 15
    CAT16 = 16
    CAT17 = 17
    CAT18 = 18
    CAT19 = 19
    CAT20 = 20
    CAT21 = 21
    CAT22 = 22
    Outfit_3 = 97
    Outfit_2 = 98
    Outfit_1 = 99


CatalogHolidayConfigs = {ConfigIds.CAT1: {'id': ConfigIds.CAT1, 'name': 'CAT1', 'dates': HolidayDates(HolidayDates.TYPE_YEARLY, [
                            (
                             Month.NOVEMBER, 1, 0, 0, 0), (Month.DECEMBER, 31, 23, 59, 0)])}, 
   ConfigIds.CAT2: {'id': ConfigIds.CAT2, 'name': 'CAT2', 'dates': HolidayDates(HolidayDates.TYPE_YEARLY, [
                            (
                             Month.DECEMBER, 1, 0, 0, 0), (Month.DECEMBER, 31, 23, 59, 0), (Month.JANUARY, 1, 0, 0, 0), (Month.JANUARY, 31, 23, 59, 0)])}, 
   ConfigIds.CAT3: {'id': ConfigIds.CAT3, 'name': 'CAT3', 'dates': HolidayDates(HolidayDates.TYPE_YEARLY, [
                            (
                             Month.JANUARY, 1, 0, 0, 0), (Month.FEBRUARY, 28, 23, 59, 0)])}, 
   ConfigIds.CAT4: {'id': ConfigIds.CAT4, 'name': 'CAT4', 'dates': HolidayDates(HolidayDates.TYPE_YEARLY, [
                            (
                             Month.FEBRUARY, 1, 0, 0, 0), (Month.MARCH, 31, 23, 59, 0)])}, 
   ConfigIds.CAT5: {'id': ConfigIds.CAT5, 'name': 'CAT5', 'dates': HolidayDates(HolidayDates.TYPE_YEARLY, [
                            (
                             Month.MARCH, 1, 0, 0, 0), (Month.APRIL, 30, 23, 59, 0)])}, 
   ConfigIds.CAT6: {'id': ConfigIds.CAT6, 'name': 'CAT6', 'dates': HolidayDates(HolidayDates.TYPE_YEARLY, [
                            (
コード例 #8
0
 'dates': HolidayDates(HolidayDates.TYPE_CUSTOM, [
     (2010, Month.MARCH, 11, 12, 0, 0),
     (2010, Month.MARCH, 11, 13, 45, 0),
     (2010, Month.MARCH, 11, 15, 0, 0),
     (2010, Month.MARCH, 11, 16, 45, 0),
     (2010, Month.MARCH, 11, 17, 0, 0),
     (2010, Month.MARCH, 11, 18, 45, 0),
     (2010, Month.MARCH, 11, 20, 0, 0),
     (2010, Month.MARCH, 11, 21, 45, 0),
     (2010, Month.MARCH, 12, 13, 0, 0),
     (2010, Month.MARCH, 12, 14, 45, 0),
     (2010, Month.MARCH, 12, 15, 0, 0),
     (2010, Month.MARCH, 12, 16, 45, 0),
     (2010, Month.MARCH, 12, 17, 0, 0),
     (2010, Month.MARCH, 12, 18, 45, 0),
     (2010, Month.MARCH, 12, 20, 0, 0),
     (2010, Month.MARCH, 12, 21, 45, 0),
     (2010, Month.MARCH, 12, 22, 0, 0),
     (2010, Month.MARCH, 12, 23, 45, 0),
     (2010, Month.MARCH, 13, 10, 0, 0),
     (2010, Month.MARCH, 13, 11, 45, 0),
     (2010, Month.MARCH, 13, 12, 0, 0),
     (2010, Month.MARCH, 13, 13, 45, 0),
     (2010, Month.MARCH, 13, 15, 0, 0),
     (2010, Month.MARCH, 13, 16, 45, 0),
     (2010, Month.MARCH, 13, 18, 0, 0),
     (2010, Month.MARCH, 13, 19, 45, 0),
     (2010, Month.MARCH, 13, 21, 0, 0),
     (2010, Month.MARCH, 13, 22, 45, 0),
     (2010, Month.MARCH, 14, 10, 0, 0),
     (2010, Month.MARCH, 14, 11, 45, 0),
     (2010, Month.MARCH, 14, 13, 0, 0),
     (2010, Month.MARCH, 14, 14, 45, 0),
     (2010, Month.MARCH, 14, 15, 0, 0),
     (2010, Month.MARCH, 14, 16, 45, 0),
     (2010, Month.MARCH, 14, 18, 0, 0),
     (2010, Month.MARCH, 14, 19, 45, 0),
     (2010, Month.MARCH, 14, 20, 0, 0),
     (2010, Month.MARCH, 14, 21, 45, 0),
     (2010, Month.MARCH, 15, 13, 0, 0),
     (2010, Month.MARCH, 15, 14, 45, 0),
     (2010, Month.MARCH, 15, 16, 0, 0),
     (2010, Month.MARCH, 15, 17, 45, 0),
     (2010, Month.MARCH, 15, 19, 0, 0),
     (2010, Month.MARCH, 15, 20, 45, 0),
     (2010, Month.MARCH, 15, 21, 0, 0),
     (2010, Month.MARCH, 15, 22, 45, 0),
     (2010, Month.MARCH, 19, 13, 0, 0),
     (2010, Month.MARCH, 19, 14, 45, 0),
     (2010, Month.MARCH, 19, 15, 0, 0),
     (2010, Month.MARCH, 19, 16, 45, 0),
     (2010, Month.MARCH, 19, 17, 0, 0),
     (2010, Month.MARCH, 19, 18, 45, 0),
     (2010, Month.MARCH, 19, 20, 0, 0),
     (2010, Month.MARCH, 19, 21, 45, 0),
     (2010, Month.MARCH, 19, 22, 0, 0),
     (2010, Month.MARCH, 19, 23, 45, 0),
     (2010, Month.MARCH, 20, 10, 0, 0),
     (2010, Month.MARCH, 20, 11, 45, 0),
     (2010, Month.MARCH, 20, 12, 0, 0),
     (2010, Month.MARCH, 20, 13, 45, 0),
     (2010, Month.MARCH, 20, 15, 0, 0),
     (2010, Month.MARCH, 20, 16, 45, 0),
     (2010, Month.MARCH, 20, 19, 0, 0),
     (2010, Month.MARCH, 20, 20, 45, 0),
     (2010, Month.MARCH, 20, 22, 0, 0),
     (2010, Month.MARCH, 20, 23, 45, 0),
     (2010, Month.MARCH, 21, 7, 0, 0),
     (2010, Month.MARCH, 21, 8, 45, 0),
     (2010, Month.MARCH, 21, 10, 0, 0),
     (2010, Month.MARCH, 21, 11, 45, 0),
     (2010, Month.MARCH, 21, 13, 0, 0),
     (2010, Month.MARCH, 21, 14, 45, 0),
     (2010, Month.MARCH, 21, 15, 0, 0),
     (2010, Month.MARCH, 21, 16, 45, 0),
     (2010, Month.MARCH, 21, 19, 0, 0),
     (2010, Month.MARCH, 21, 20, 45, 0),
     (2010, Month.MARCH, 21, 22, 0, 0),
     (2010, Month.MARCH, 21, 23, 45, 0),
     (2010, Month.MARCH, 22, 13, 0, 0),
     (2010, Month.MARCH, 22, 14, 45, 0),
     (2010, Month.MARCH, 22, 16, 0, 0),
     (2010, Month.MARCH, 22, 17, 45, 0),
     (2010, Month.MARCH, 22, 19, 0, 0),
     (2010, Month.MARCH, 22, 20, 45, 0),
     (2010, Month.MARCH, 22, 21, 0, 0),
     (2010, Month.MARCH, 22, 22, 45, 0)]) },