Example #1
0
if __name__ == "__main__":
    config = yaml.load(open("config.yml").read(), Loader=yaml.SafeLoader)

    args = parse_arguments()

    rm = RegMaster(config["regmaster_password"], config["regmaster_endpoint"])
    # result = rm.validate(args.email)
    # if "error" in result:
    #     print(f"Not Registered: {result['error']}")
    # else:
    #     print(f"Registered: {json.dumps(result, indent=2)}")
    result = rm.validate(args.email)
    if result == None:
        print(f"Registered")
    else:
        print(f"Not Registered: {result}")

    auth0 = Auth0(config["auth0_domain"], config["auth0_connection"], config["auth0_client_id"], config["auth0_client_secret"])
    result = auth0.getUser(args.email)
    if len(result) == 0:
        print("No In Auth0.")
    else:
        print("In Auth0")

    gather = Gather(config["gather_api_key"], config["gather_space_id"])
    dict = gather.getGatherEmailDictionary()

    if args.email in dict: 
        print("In Gather")
    else:
        print("Not In Gather")
import requests
import yaml

from libgather import Gather
from libregmaster import RegMaster


def makeGatherEmailDictionary(auth0Users):
    # return dict([(x["email"], {"name": x["name"]}) for x in auth0Users])
    return dict([(x["email"], {}) for x in auth0Users])


if __name__ == "__main__":
    config = yaml.load(open("config.yml").read(), Loader=yaml.SafeLoader)

    gather = Gather(config["gather_api_key"], config["gather_space_id"])
    originalGatherDict = gather.getGatherEmailDictionary()

    rm = RegMaster(config["regmaster_password"], config["regmaster_endpoint"])
    users = rm.allRegistered()

    # remove any blacklisted users
    blacklist = yaml.load(requests.get(config["blacklist"]).text,
                          Loader=yaml.SafeLoader)
    users = [x for x in users if x["email"] not in blacklist]

    emailDict = makeGatherEmailDictionary(users)

    gather.setGatherEmailDictionary(
        emailDict,
        len(originalGatherDict) == 0,
Example #3
0
import time
import argparse

import requests
import yaml

from libgather import Gather


def parse_arguments():
    parser = argparse.ArgumentParser(
        description="MiniConf Portal Command Line")
    parser.add_argument("email", help="email address of user")
    return parser.parse_args()


if __name__ == "__main__":
    config = yaml.load(open("config.yml").read(), Loader=yaml.SafeLoader)

    args = parse_arguments()

    gather = Gather(config["gather_api_key"], config["gather_space_id"])
    dict = gather.getGatherEmailDictionary()

    del dict[args.email]

    gather.setGatherEmailDictionary(
        dict,
        True  # Must overwrite here...  This is racy with other updates!
    )
Example #4
0
import csv
import io
import json
import time
import zlib
import sys

import requests
import yaml

sys.path.append("../admin")

from libgather import Gather

if __name__ == "__main__":
    roomName = sys.argv[1]
    config = yaml.load(open("../admin/config.yml").read(),
                       Loader=yaml.SafeLoader) | yaml.load(
                           open("config.yml").read(), Loader=yaml.SafeLoader)

    gather = Gather(config["gather_api_key"], config["gather_space_id"])

    map = gather.getMap(roomName)
    print(json.dumps(map, indent=2, sort_keys=True))
Example #5
0
def login():
    data = {}

    print("Starting...")

    rm = RegMaster(config["regmaster_password"], config["regmaster_endpoint"])
    registeredAndPaid = set([x["email"] for x in rm.allRegistered()])
    registered = rm.allRegisteredWithUnpaid()
    print("Got RegMaster...")

    auth0 = Auth0(config["auth0_domain"], config["auth0_connection"],
                  config["auth0_client_id"], config["auth0_client_secret"])
    inAuth0 = sorted(auth0.userList(), key=lambda x: x["email"])

    print("Got Auth0...")

    gather = Gather(config["gather_api_key"], config["gather_space_id"])
    inGather = gather.getGatherEmailDictionary().keys()
    blacklist = yaml.load(requests.get(config["blacklist"]).text,
                          Loader=yaml.SafeLoader)

    print("Got Gather...")

    names = dict([(x["email"], x["name"]) for x in registered])

    allEmails = set(names.keys())
    allEmails = allEmails.union(set([x["email"] for x in inAuth0]))
    allEmails = allEmails.union(set(inGather))
    allEmails = allEmails.union(set(blacklist))

    info = []
    for email in sorted(allEmails):

        inRegMaster = email in names
        paid = email in registeredAndPaid

        signedOn = False
        blocked = False
        for x in inAuth0:
            if x["email"] == email:
                signedOn = True
                s = x.get("blocked", "false")
                if s == "true":
                    print(str(x) + " " + s)
                    blocked = True

        info.append({
            "order": len(info) + 1,
            "email": email,
            "name": names.get(email, "??"),
            "registered": inRegMaster,
            "paid": paid,
            "website": signedOn,
            "blocked": blocked,
            "gather": email in inGather,
            "blacklisted": email in blacklist
        })

    data["users"] = info
    # print(data)
    return render_template("index.html", **data)
Example #6
0
import csv
import io
import json
import time
import zlib
import sys
import os

import requests
import yaml
from libgather import Gather

if __name__ == "__main__":
    config = yaml.load(open("../admin/config.yml").read(),
                       Loader=yaml.SafeLoader) | yaml.load(
                           open("config.yml").read(), Loader=yaml.SafeLoader)
    rooms = yaml.load(open("poster-rooms.yml").read(), Loader=yaml.SafeLoader)
    gather = Gather(config["gather_api_key"], config["gather_space_id"])
    for room in rooms:
        roomName = f'room-{room["UID"]}'
        jsonContents = json.load(open(f'auto/room-{room["UID"]}.json'))
        gather.setMap(roomName, jsonContents)
import csv
import io
import json
import time
import zlib
import sys

import requests
import yaml

from libgather import Gather

if __name__ == "__main__":
    roomName = sys.argv[1]
    jsonContents = sys.argv[2]
    config = yaml.load(open("../admin/config.yml").read(),
                       Loader=yaml.SafeLoader) | yaml.load(
                           open("config.yml").read(), Loader=yaml.SafeLoader)

    gather = Gather(config["gather_api_key"], config["gather_space_id"])

    with open(jsonContents) as f:
        data = json.load(f)

    gather.setMap(roomName, data)
#!/usr/bin/env python3

import csv
import io
import json
import time
import argparse

import requests
import yaml

from libgather import Gather

if __name__ == "__main__":
    config = yaml.load(open("config.yml").read(), Loader=yaml.SafeLoader)

    gather = Gather(config["gather_api_key"], config["gather_space_id"])
    users = [(k,v.get("name", "")) for k,v in gather.getGatherEmailDictionary().items()]
    print("email,name")
    for email,name in sorted(users, key=lambda x: x[0]):
        print(f"{email},{name}")