components.Orchestra¶
- class components.Orchestra¶
Bases:
components.picklablebase.PicklableBase
An orchestra. Keeps tracks of its members.
Note
Orchestra instance support subscription for all attribute managers listed as keys of
SUBSCRIPTABLE
.- attribute_managers¶
A dictionary of attribute managers keeping track of the members
- Type
Dict[
str
,components.AttributeManager
]
- SUBSCRIPTABLE = ['address', 'addresses', 'age', 'ages', 'birthday', 'birthdays', 'first_name', 'first_names', 'full_name', 'full_names', 'instruments', 'last_name', 'last_names', 'nickname', 'nicknames', 'photo_file_id', 'photo_file_ids', 'joined', 'functions']¶
Attribute managers supported by subscription.
- Type
List[
str
]
- TO_HR: Dict[str, str] = {'address': 'Adresse', 'addresses': 'Adresse', 'age': 'Alter', 'ages': 'Alter', 'birthday': 'Geburtstag', 'birthdays': 'Geburtstag', 'first_name': 'Vorname', 'first_names': 'Vorname', 'full_name': 'Ganzer Name', 'full_names': 'Ganzer Name', 'functions': 'Ämter', 'instruments': 'Instrument', 'joined': 'Beitrittsjahr', 'last_name': 'Nachname', 'last_names': 'Nachname', 'nickname': 'Spitzname', 'nicknames': 'Spitzname', 'photo_file_id': 'Foto', 'photo_file_ids': 'Foto'}¶
A map from the names of the different properties of this class to the human readable strings.
- kick_member(member)¶
Kicks a member from the orchestra.
- Parameters
member (
Member
) – The member to kick.- Raises
ValueError – If member is not registered.
- Return type
- property members: Dict[int, components.member.Member]¶
All the members of the orchestra. The keys are the
components.Member.user_id
s, the values are the actual members.
- property months_score: List[components.score.Score]¶
Gives a list of each members score of the current month sorted descending by
components.Score.ratio
.
- months_score_text(length=None, html=False)¶
String representation of
months_score
.
- property overall_score: List[components.score.Score]¶
Gives a list of each members overall score sorted descending by
components.Score.ratio
.
- overall_score_text(length=None, html=False)¶
String representation of
overall_score
.
- questionable(multiple_choice=True, exclude_members=None)¶
Gives a list of tuples of
components.AttributeManager
instances, each representing a pair of hint attribute and question attribute, which have enough different values for the orchestras members to generate questions from it.- Parameters
- Return type
- register_member(member)¶
Registers a new member for this orchestra.
Note
Copies the member so changes to the instance wont directly affect the orchestra. Use
update_member()
to update the information about this member.- Parameters
member (
Member
) – The new member- Raises
ValueError – If member is already registered.
- Return type
- property todays_score: List[components.score.Score]¶
Gives a list of each members score of today sorted descending by
components.Score.ratio
.
- todays_score_text(length=None, html=False)¶
String representation of
todays_score
.
- update_member(member)¶
Updates the information of a member. As
register_user()
, this will copy the member. To update the information again, call this method again.
- property weeks_score: List[components.score.Score]¶
Gives a list of each members score of the current week sorted descending by
components.Score.ratio
.
- weeks_score_text(length=None, html=False)¶
String representation of
weeks_score
.
- property years_score: List[components.score.Score]¶
Gives a list of each members score of the current year sorted descending by
components.Score.ratio
.
- years_score_text(length=None, html=False)¶
String representation of
years_score
.