heig.gaps¶
Copyright 2019,2020 Gabriel Roch
This file is part of heig-bot.
heig-bot is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
heig-bot is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with heig-bot. If not, see <https://www.gnu.org/licenses/>.
-
class
heig.gaps.Gaps(user)[source]¶ Class for access to GAPS account
Variables: -
__dict__= mappingproxy({'__module__': 'heig.gaps', '__doc__': '\n Class for access to GAPS account\n\n :ivar _user: User object for GAPS access\n :vartype _user: User\n\n :ivar _data: GAPS information\n _data["notes"][2020]["ANA"] = GradeCourse\n _data["gapsid"] = id for GAPS\n :vartype _data: User\n ', '__init__': <function Gaps.__init__>, 'is_registred': <function Gaps.is_registred>, 'get_timetable_ics': <function Gaps.get_timetable_ics>, 'get_day_lesson': <function Gaps.get_day_lesson>, 'set_credentials': <function Gaps.set_credentials>, 'unset_credentials': <function Gaps.unset_credentials>, 'get_notes_online': <function Gaps.get_notes_online>, 'get_notes': <function Gaps.get_notes>, 'send_notes_course': <function Gaps.send_notes_course>, 'send_notes': <function Gaps.send_notes>, 'send_notes_all': <function Gaps.send_notes_all>, 'check_gaps_notes': <function Gaps.check_gaps_notes>, '__dict__': <attribute '__dict__' of 'Gaps' objects>, '__weakref__': <attribute '__weakref__' of 'Gaps' objects>})¶
-
__module__= 'heig.gaps'¶
-
__weakref__¶ list of weak references to the object (if defined)
-
get_day_lesson(dt: arrow.arrow.Arrow = <Arrow [2020-03-03T06:19:29.904354+00:00]>, text: bool = False)[source]¶ Parameters: - dt – Date for show lesson
- text – Return type is text
-
get_notes(year)[source]¶ Get notes from cache, if no cache for this year download from GAPS
Parameters: year – Year to get (for 2020-2021 is 2020)
-
get_notes_online(year)[source]¶ Get notes from GAPS
Parameters: year – Year to get (for 2020-2021 is 2020)
-
get_timetable_ics(year, trimester, id, type, force=False)[source]¶ Get ICS file. File in cache is used if possible.
Parameters:
-
send_notes(year, courses, chat_id)[source]¶ Send notes for multiple branche
Parameters: - year – Year to send (for 2020-2021 is 2020)
- courses – list of branchname to send
- chat_id (int) – send message to this chat id
-
send_notes_all(chat_id)[source]¶ Send all notes in cache
Parameters: chat_id (int) – send message to this chat id
-
send_notes_course(year, course, chat_id, notes=0, prefix='')[source]¶ Send notes for branche
Parameters:
-
-
exception
heig.gaps.GapsError[source]¶ Class for manage exception on Gaps
-
__module__= 'heig.gaps'¶
-
__weakref__¶ list of weak references to the object (if defined)
-
-
class
heig.gaps.GradeCourse(name, average)[source]¶ Class for stockage of grade course.
Cette classe corresponds à une branche
Variables: - name (str) –
- average –
- evals –
-
__dict__= mappingproxy({'__module__': 'heig.gaps', '__doc__': '\n Class for stockage of grade course.\n\n Cette classe corresponds à une branche\n\n :ivar name: \n :vartype name: str\n\n :ivar average: \n :vartype average:\n\n :ivar evals: \n :vartype evals:\n ', '__init__': <function GradeCourse.__init__>, '__eq__': <function GradeCourse.__eq__>, 'str': <function GradeCourse.str>, '__dict__': <attribute '__dict__' of 'GradeCourse' objects>, '__weakref__': <attribute '__weakref__' of 'GradeCourse' objects>, '__hash__': None})¶
-
__hash__= None¶
-
__init__(name, average)[source]¶ Make a new GradeCourse object
Parameters: - name (str) – Name of course
- average – Average of course for user
-
__module__= 'heig.gaps'¶
-
__weakref__¶ list of weak references to the object (if defined)
-
class
heig.gaps.GradeEvaluation(description, date, classaverage, grade, coeff)[source]¶ Class for stockage of a evaluation
Variables: - date –
- description –
- classaverage –
- grade –
- coeff –
-
__dict__= mappingproxy({'__module__': 'heig.gaps', '__doc__': '\n Class for stockage of a evaluation\n\n :ivar date: \n :vartype date:\n\n :ivar description: \n :vartype description:\n\n :ivar classaverage: \n :vartype classaverage:\n\n :ivar grade: \n :vartype grade:\n\n :ivar coeff: \n :vartype coeff:\n ', '__init__': <function GradeEvaluation.__init__>, '__eq__': <function GradeEvaluation.__eq__>, 'str': <function GradeEvaluation.str>, '__dict__': <attribute '__dict__' of 'GradeEvaluation' objects>, '__weakref__': <attribute '__weakref__' of 'GradeEvaluation' objects>, '__hash__': None})¶
-
__hash__= None¶
-
__init__(description, date, classaverage, grade, coeff)[source]¶ Initialize self. See help(type(self)) for accurate signature.
-
__module__= 'heig.gaps'¶
-
__weakref__¶ list of weak references to the object (if defined)
-
class
heig.gaps.GradeGroupEvaluation(average, coeff)[source]¶ Class for stockage of grade group of evaluation
Cette classe corresponds à un groupe d’une branche (labo ou controlecontinus)
Variables: - average –
- coeff –
- evals –
-
__dict__= mappingproxy({'__module__': 'heig.gaps', '__doc__': "\n Class for stockage of grade group of evaluation\n\n Cette classe corresponds à un groupe d'une branche (labo ou controlecontinus)\n\n :ivar average: \n :vartype average:\n\n :ivar coeff: \n :vartype coeff:\n\n :ivar evals: \n :vartype evals:\n ", '__init__': <function GradeGroupEvaluation.__init__>, '__eq__': <function GradeGroupEvaluation.__eq__>, 'str': <function GradeGroupEvaluation.str>, '__dict__': <attribute '__dict__' of 'GradeGroupEvaluation' objects>, '__weakref__': <attribute '__weakref__' of 'GradeGroupEvaluation' objects>, '__hash__': None})¶
-
__hash__= None¶
-
__module__= 'heig.gaps'¶
-
__weakref__¶ list of weak references to the object (if defined)