Update README.rst
[PyCIM.git] / CIM14 / CPSM / Equipment / LoadModel / Season.py
blobbb77d9192d185b574528b424fc1aac924f50b087
1 # Copyright (C) 2010-2011 Richard Lincoln
3 # Permission is hereby granted, free of charge, to any person obtaining a copy
4 # of this software and associated documentation files (the "Software"), to
5 # deal in the Software without restriction, including without limitation the
6 # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
7 # sell copies of the Software, and to permit persons to whom the Software is
8 # furnished to do so, subject to the following conditions:
10 # The above copyright notice and this permission notice shall be included in
11 # all copies or substantial portions of the Software.
13 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
18 # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
19 # IN THE SOFTWARE.
21 from CIM14.CPSM.Equipment.Element import Element
23 class Season(Element):
24 """A specified time period of the year, e.g., Spring, Summer, Fall, Winter- To specify a relative date as the startDate or endDate for a Season, the year component of the ISO 8601 date format (“YYYY-MM-DD”) can be omitted. The resulting format would be “MM-DD”.
25 """
27 def __init__(self, startDate='', endDate='', name="fall", SeasonDayTypeSchedules=None, *args, **kw_args):
28 """Initialises a new 'Season' instance.
30 @param startDate: Date season starts
31 @param endDate: Date season ends
32 @param name: Name of the Season Values are: "fall", "winter", "spring", "summer"
33 @param SeasonDayTypeSchedules: Schedules that use this Season.
34 """
35 #: Date season starts
36 self.startDate = startDate
38 #: Date season ends
39 self.endDate = endDate
41 #: Name of the Season Values are: "fall", "winter", "spring", "summer"
42 self.name = name
44 self._SeasonDayTypeSchedules = []
45 self.SeasonDayTypeSchedules = [] if SeasonDayTypeSchedules is None else SeasonDayTypeSchedules
47 super(Season, self).__init__(*args, **kw_args)
49 _attrs = ["startDate", "endDate", "name"]
50 _attr_types = {"startDate": str, "endDate": str, "name": str}
51 _defaults = {"startDate": '', "endDate": '', "name": "fall"}
52 _enums = {"name": "SeasonName"}
53 _refs = ["SeasonDayTypeSchedules"]
54 _many_refs = ["SeasonDayTypeSchedules"]
56 def getSeasonDayTypeSchedules(self):
57 """Schedules that use this Season.
58 """
59 return self._SeasonDayTypeSchedules
61 def setSeasonDayTypeSchedules(self, value):
62 for x in self._SeasonDayTypeSchedules:
63 x.Season = None
64 for y in value:
65 y._Season = self
66 self._SeasonDayTypeSchedules = value
68 SeasonDayTypeSchedules = property(getSeasonDayTypeSchedules, setSeasonDayTypeSchedules)
70 def addSeasonDayTypeSchedules(self, *SeasonDayTypeSchedules):
71 for obj in SeasonDayTypeSchedules:
72 obj.Season = self
74 def removeSeasonDayTypeSchedules(self, *SeasonDayTypeSchedules):
75 for obj in SeasonDayTypeSchedules:
76 obj.Season = None