示例#1
0
simple_start = True
url = ""  # Make sure to include the http:// in the url if not in simple start
username = ""
password = ""
classes = [
]  # Make sure to type them exactly as they appear in PowerSchool if not in simple start

grades = []
temp_grades = []

slack = MessageHandler(SLACK_TOKEN)
slack.start()

if simple_start:
    slack.send("Welcome to the PowerSchool bot!\n")
    sleep(1)
    slack.send("Let's start with some basic setup.\n")
    slack.send("Please send the url of your login page of powerschool.")
    while slack.get_message(
    ) == "Please send the url of your login page of powerschool.".strip(
    ).lower():
        sleep(0.5)
    url = slack.get_message()
    url = url[1:url.index("|")]

    slack.send("What is your PowerSchool username?")
    while slack.get_message() == "What is your PowerSchool username?".lower(
    ).strip():
        sleep(0.5)
    username = slack.get_message()
示例#2
0
    concent_public_key = key_manager.get_concent_public_key()

    if args.print_keys:
        print_keys(
            requestor_public_key,
            requestor_private_key,
            provider_public_key,
            provider_private_key,
            concent_public_key,
        )

    message_handler = MessageHandler(
        requestor_private_key,
        requestor_public_key,
        provider_public_key,
        provider_private_key,
        concent_public_key,
    )

    if args.endpoint == 'send':
        json_data = get_json_data(args.message_file, args.message)
        message = MessageExtractor(
            requestor_public_key,
            provider_public_key
        ).extract_message(json_data)

        message_handler.send(cluster_url, message)

    elif args.endpoint == 'receive' or 'receive-out-of-band':
        message_handler.receive(cluster_url, args.party, args.endpoint)
示例#3
0
import time

import constants
# from temperature_generators.wmi_temperature_generator import WmiTemperatureGenerator
from temperature_generators.fake_temperature_generator import FakeTemperatureGenerator
from message_handler import MessageHandler
from model.temperature_data import TemperaturData

# temperatureGenerator = WmiTemperatureGenerator() #requires OpenHardwareMonitor up and running
temperatureGenerator = FakeTemperatureGenerator()
messageHandler = MessageHandler()

while True:
    time.sleep(constants.MESSAGE_INTERVAL)
    temperature = temperatureGenerator.getCurrentTemperature()
    messageHandler.send(TemperaturData(temperature).toJson())