예제 #1
0
def print_init():
    """Print a message to indicate that the machine has restarted.
    """

    try:
        r = requests.get("https://api.ipify.org")
        ip = r.text
        printer.print_message("I'm Alive!" + "\n" + ip)
    except:
        printer.print_message("I'm Alive!\nNo Network :'(")
예제 #2
0
def main_loop():
    ser = serial.Serial(SERIAL_PORT, BAUD)

    while True:
        ser.flushInput()
        time.sleep(0.1)
        msg = ser.readline().decode().strip()

        if msg != "":
            lolcode = users.get_lolcode(msg)
            kerb = users.get_kerb(lolcode)

            print("LOLcode:", lolcode)

            if kerb:
                printer.print_label(kerb, datetime.datetime.now())
            else:
                printer.print_message("LOLcode: " + lolcode +
                                      "\nBring this to Shreyas!")

        ser.flushInput()
        time.sleep(DELAY)
예제 #3
0
def _join(donations, contacts, config):
    data = donations.merge(contacts, how="outer", on="PeopleID")
    print_message("- Donations and contacts merged", config)
    return data
예제 #4
0
def _load_donations(config):
    donations = pandas.read_csv(config["inputs"]["donations"] +
                                "Donation_April_2020.csv")
    print_message("- Donations data loaded", config)
    return donations
예제 #5
0
def _load_contacts(config):
    contacts = pandas.read_csv(config["inputs"]["contacts"] +
                               "Contact_April_2020.csv")
    print_message("- Contacts data loaded", config)
    return contacts