示例#1
0
 def getHomeworks(self):
     self.client = pronotepy.Client(credential.url,
                                    cookies=ac_reims(
                                        credential.username,
                                        credential.password))
     formattedHomeworks = []
     homeworks = self.client.homework(
         datetime.date.today(),
         (datetime.date.today() + datetime.timedelta(days=14)))
     for hw in homeworks:
         formattedHomeworks.append([
             hw.subject.name + " " + hw.date.strftime('%d - %m - %Y') +
             " ``` \n" + hw.description + "\n ```", hw.files
         ])
     #print(formattedHomeworks)
     return formattedHomeworks
示例#2
0
    def run(self):
        self.line = session.query(Config).one()

        self.credentialsGoogle = pickle.loads(
            codecs.decode(self.line.token_google.encode(), "base64"))
        self.todo_client = pickle.loads(
            codecs.decode(self.line.token_todo.encode(), "base64"))

        self.client = pronotepy.Client(self.urlPronote,
                                       username=self.usernamePronote,
                                       password=self.mdpPronote,
                                       ent=self.ent)
        self.sched()
        scheduler = BlockingScheduler()
        scheduler.add_job(self.coursToAgenda,
                          'cron',
                          day_of_week='sun',
                          hour='17',
                          minute='00')
        scheduler.add_job(self.sched, 'interval', minutes=30)
        print("I'm working")
        scheduler.start()
示例#3
0
import datetime
import typing
import unittest

import pronotepy

client = pronotepy.Client('https://demo.index-education.net/pronote/eleve.html', 'demonstration', 'pronotevs')


class TestClient(unittest.TestCase):
    global client

    def test__get_week(self):
        self.assertEqual(client.get_week(client.start_day + datetime.timedelta(days=8)), 2)

    def test_lessons(self):
        start = client.start_day
        end = client.start_day + datetime.timedelta(days=8)
        lessons = client.lessons(start, end)
        # We assume demo website will always have some lessons
        self.assertGreater(len(lessons), 0)
        for lesson in lessons:
            self.assertLessEqual(start, lesson.start.date())
            self.assertLessEqual(lesson.start.date(), end)

    def test_periods(self):
        self.assertIsNotNone(client.periods)

    def test_current_period(self):
        self.assertIsNotNone(client.current_period)
示例#4
0
# -*- coding: utf-8 -*-
import env_file
import pronotepy
import datetime
import html
import pickle

client = pronotepy.Client(
    'https://0060013g.index-education.net/pronote/eleve.html?login=true')
if client.login(
        env_file.get(path='.env')['USERNAME'],
        env_file.get(path='.env')['PASSWORD']):
    print("Login Successful")

homework_backup = {}
profs_backup = {}
manual_add_list = {}


def save_obj(obj, name):
    with open('obj/' + name + '.pkl', 'wb') as f:
        pickle.dump(obj, f, pickle.HIGHEST_PROTOCOL)


def load_obj(name):
    with open('obj/' + name + '.pkl', 'rb') as f:
        return pickle.load(f)


def yes_or_no(boolean: bool):
    if boolean:
示例#5
0
 def reConnect(self):
     self.client = pronotepy.Client(credential.url,
                                    cookies=ac_reims(
                                        credential.username,
                                        credential.password))
     return None
示例#6
0
import pronotepy
from pronotepy.ent import ac_reunion
# importing ent specific function, you do not need to import anything if you dont use an ent

client = pronotepy.Client(
    'https://demo.index-education.net/pronote/eleve.html',
    username='******',
    password='******')
#                      ent=ac_reunion) # ent specific
if client.logged_in:
    print(len(client.messages()))