1- import logging
2- from enum import Enum
3- from typing import Self
4-
5- _logger = logging .getLogger (__name__ )
6-
71class OfficerPosition :
82 PRESIDENT = "president"
93 VICE_PRESIDENT = "vice-president"
@@ -32,6 +26,13 @@ class OfficerPosition:
3226 def position_list () -> list [str ]:
3327 return _OFFICER_POSITION_LIST
3428
29+ @staticmethod
30+ def length_in_semesters (position : str ) -> int | None :
31+ # TODO: ask the committee to maintain a json file with all the important details from the constitution
32+ # (I can create the version version of the file)
33+ """How many semester position is active for, according to the CSSS Constitution"""
34+ return _LENGTH_MAP [position ]
35+
3536 @staticmethod
3637 def to_email (position : str ) -> str | None :
3738 return _EMAIL_MAP .get (position , None )
@@ -43,13 +44,13 @@ def num_active(position: str) -> int | None:
4344 """
4445 # None means there can be any number active
4546 if (
46- position == OfficerPosition .ExecutiveAtLarge
47- or position == OfficerPosition .FirstYearRepresentative
47+ position == OfficerPosition .EXECUTIVE_AT_LARGE
48+ or position == OfficerPosition .FIRST_YEAR_REPRESENTATIVE
4849 ):
4950 return 2
5051 elif (
51- position == OfficerPosition .FroshWeekChair
52- or position == OfficerPosition .SocialMediaManager
52+ position == OfficerPosition .FROSH_WEEK_CHAIR
53+ or position == OfficerPosition .SOCIAL_MEDIA_MANAGER
5354 ):
5455 return None
5556 else :
@@ -61,38 +62,38 @@ def is_signer(position: str) -> bool:
6162 If the officer is a signing authority of the CSSS
6263 """
6364 return (
64- position == OfficerPosition .President
65- or position == OfficerPosition .VicePresident
66- or position == OfficerPosition .Treasurer
67- or position == OfficerPosition .DirectorOfResources
68- or position == OfficerPosition .DirectorOfEvents
65+ position == OfficerPosition .PRESIDENT
66+ or position == OfficerPosition .VICE_PRESIDENT
67+ or position == OfficerPosition .TREASURER
68+ or position == OfficerPosition .DIRECTOR_OF_RESOURCES
69+ or position == OfficerPosition .DIRECTOR_OF_EVENTS
6970 )
7071
7172 @staticmethod
7273 def expected_positions () -> list [str ]:
7374 return [
74- OfficerPosition .President ,
75- OfficerPosition .VicePresident ,
76- OfficerPosition .Treasurer ,
77-
78- OfficerPosition .DirectorOfResources ,
79- OfficerPosition .DirectorOfEvents ,
80- OfficerPosition .DirectorOfEducationalEvents ,
81- OfficerPosition .AssistantDirectorOfEvents ,
82- OfficerPosition .DirectorOfCommunications ,
83- #DirectorOfOutreach , # TODO: when https://github.com/CSSS/documents/pull/9/files merged
84- OfficerPosition .DirectorOfMultimedia ,
85- OfficerPosition .DirectorOfArchives ,
86- OfficerPosition .ExecutiveAtLarge ,
75+ OfficerPosition .PRESIDENT ,
76+ OfficerPosition .VICE_PRESIDENT ,
77+ OfficerPosition .TREASURER ,
78+
79+ OfficerPosition .DIRECTOR_OF_RESOURCES ,
80+ OfficerPosition .DIRECTOR_OF_EVENTS ,
81+ OfficerPosition .DIRECTOR_OF_EDUCATIONAL_EVENTS ,
82+ OfficerPosition .ASSISTANT_DIRECTOR_OF_EVENTS ,
83+ OfficerPosition .DIRECTOR_OF_COMMUNICATIONS ,
84+ #OfficerPosition.DIRECTOR_OF_OUTREACH , # TODO: when https://github.com/CSSS/documents/pull/9/files merged
85+ OfficerPosition .DIRECTOR_OF_MULTIMEDIA ,
86+ OfficerPosition .DIRECTOR_OF_ARCHIVES ,
87+ OfficerPosition .EXECUTIVE_AT_LARGE ,
8788 # TODO: expect these only during fall & spring semesters. Also, TODO: this todo is correct...
88- #FirstYearRepresentative ,
89+ #OfficerPosition.FIRST_YEAR_REPRESENTATIVE ,
8990
9091 #ElectionsOfficer,
91- OfficerPosition .SFSSCouncilRepresentative ,
92- OfficerPosition .FroshWeekChair ,
92+ OfficerPosition .SFSS_COUNCIL_REPRESENTATIVE ,
93+ OfficerPosition .FROSH_WEEK_CHAIR ,
9394
94- OfficerPosition .SystemAdministrator ,
95- OfficerPosition .Webmaster ,
95+ OfficerPosition .SYSTEM_ADMINISTRATOR ,
96+ OfficerPosition .WEBMASTER ,
9697 ]
9798
9899_EMAIL_MAP = {
@@ -120,6 +121,34 @@ def expected_positions() -> list[str]:
120121 OfficerPosition .SOCIAL_MEDIA_MANAGER : "N/A" ,
121122}
122123
124+ # TODO: when an officer's start date is modified, update the end date as well if it's defined in this list
125+ # a number of semesters (a semester begins on the 1st of each four month period, starting january)
126+ # None, means that the length of the position does not have a set length in semesters
127+ _LENGTH_MAP = {
128+ OfficerPosition .PRESIDENT : 3 ,
129+ OfficerPosition .VICE_PRESIDENT : 3 ,
130+ OfficerPosition .TREASURER : 3 ,
131+
132+ OfficerPosition .DIRECTOR_OF_RESOURCES : 3 ,
133+ OfficerPosition .DIRECTOR_OF_EVENTS : 3 ,
134+ OfficerPosition .DIRECTOR_OF_EDUCATIONAL_EVENTS : 3 ,
135+ OfficerPosition .ASSISTANT_DIRECTOR_OF_EVENTS : 3 ,
136+ OfficerPosition .DIRECTOR_OF_COMMUNICATIONS : 3 ,
137+ #OfficerPosition.DIRECTOR_OF_OUTREACH: 3,
138+ OfficerPosition .DIRECTOR_OF_MULTIMEDIA : 3 ,
139+ OfficerPosition .DIRECTOR_OF_ARCHIVES : 3 ,
140+ OfficerPosition .EXECUTIVE_AT_LARGE : 1 ,
141+ OfficerPosition .FIRST_YEAR_REPRESENTATIVE : 2 ,
142+
143+ OfficerPosition .ELECTIONS_OFFICER : None ,
144+ OfficerPosition .SFSS_COUNCIL_REPRESENTATIVE : 3 ,
145+ OfficerPosition .FROSH_WEEK_CHAIR : None ,
146+
147+ OfficerPosition .SYSTEM_ADMINISTRATOR : None ,
148+ OfficerPosition .WEBMASTER : None ,
149+ OfficerPosition .SOCIAL_MEDIA_MANAGER : None ,
150+ }
151+
123152_OFFICER_POSITION_LIST = [
124153 OfficerPosition .PRESIDENT ,
125154 OfficerPosition .VICE_PRESIDENT ,
0 commit comments