Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added background_color support for lessons and homework. #5

Merged
merged 1 commit into from
Mar 20, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions pronotepy/dataClasses.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,19 +273,22 @@ class Lesson:
if the lesson is canceled
status : str
status of the lesson
background_color : str
background color of the lesson
outing : bool
if it is a pedagogical outing
start : str
starting time of the lesson
group_name : str
Name of the group."""
__slots__ = ['id', 'subject', 'teacher_name', 'classroom', 'start',
'canceled', 'status', 'detention', 'end', 'outing', 'group_name', 'student_class', '_client', '_content']
'canceled', 'status', 'background_color', 'detention', 'end', 'outing', 'group_name', 'student_class', '_client', '_content']
attribute_guide = {
'DateDuCours,V': ('start', lambda d: datetime.datetime.strptime(d, '%d/%m/%Y %H:%M:%S')),
'N': ('id', str),
'estAnnule': ('canceled', bool),
'Statut': ('status', str),
'CouleurFond': ('background_color', str),
'estRetenue': ('detention', bool),
'duree': ('end', int),
'estSortiePedagogique': ('outing', bool)
Expand Down Expand Up @@ -445,17 +448,20 @@ class Homework:
the subject that the homework is for
description : str
the description of the homework
background_color : str
the background color of the homework
done : bool
if the homework is marked done
date : str
deadline
"""
__slots__ = ['id', 'subject', 'description', 'done', '_client', 'date', '_files']
__slots__ = ['id', 'subject', 'description', 'done', 'background_color', '_client', 'date', '_files']
attribute_guide = {
'N': ('id', str),
'descriptif,V': ('description', lambda d: re.sub(re.compile('<.*?>'), '', d)),
'TAFFait': ('done', bool),
'Matiere,V': ('subject', Subject),
'CouleurFond': ('background_color', str),
'PourLe,V': ('date', lambda d: datetime.datetime.strptime(d, '%d/%m/%Y').date()),
'ListePieceJointe,V': ('_files', tuple)
}
Expand Down