Example #1
0
def forgotpass():
    try:
        logout_user()
    except:
        pass

    if request.method == "POST":
        try:
            logout_user()
        except:
            pass

        from sendemail import send_mail
        email = request.form.get('femail')
        user = User.query.filter_by(email=email).first()

        if user != None:

            a = send_mail(email, user.hint)
            flash(a)
            return redirect(url_for('auth.index'))
        else:

            flash("Email Does'nt Exist.")
            return redirect(url_for('auth.forgotpass'))

    return render_template('forgotpass.html')
Example #2
0
            store_apdf.to_csv('store_TEMP' + str(block_num) +
                              '.csv')  # Saving the data array to a CSV.

store_apdf.to_csv('store_' + suffix +
                  '.csv')  # Saving the data array to a CSV.

pool.close()

end = time.time()  #record finish time

endmsg = "TOOK " + str(round(end - start, 3)) + " SECONDS \n\n"
print(endmsg)

try:
    send_mail('*****@*****.**', '*****@*****.**',
              'sim_expts.py' + ' :' + suffix + ': ' + 'complete', endmsg, None,
              'smtp.gmail.com')
except:
    print("Couldn't send mail notification")
'''
import pylab as plt
df=pd.read_csv('audit_first_expt_data.csv')
df.groupby(['subj_idx','condition'])['rt','response'].mean()
rts=df.groupby(['subj_idx','condition'])['rt','response'].mean().reset_index()['rt'].values
acc=df.groupby(['subj_idx','condition'])['rt','response'].mean().reset_index()['response'].values
plt.clf()
plt.plot(rts,acc,'.')
spd=1/rts
plt.plot(spd,acc,'.')
import seaborn as sns
sns.jointplot(rts,acc,kind="hex")
Example #3
0
                    subjectTitle=subjectTitle + key;
                    subsoup = BeautifulSoup(tempstr)
                    objectHyperlink = subsoup.a['href']
                    objectTitle = subsoup.a['title']
                    if not checkfile.exists(filePathName):
                        filehandle = open(filePathName,'w')
                        filehandle.close();
                    if not hasThisLink(objectHyperlink,filePathName):
                        mailContent = mailContent+objectHyperlink
                        mailContent = mailContent+"\n" #
                        mailContent = mailContent+objectTitle
                        mailContent = mailContent+"\n" #
                        sendThisMail=True
                        filehandle = open('linkrecord.txt','a')
                        try:
                            filehandle.writelines(objectHyperlink)
                            filehandle.write("\n")
                        finally:filehandle.close()
                    else:
                        print objectTitle,"but message has been sent"
#print mailContent,subjectTitle
#print type(mailContent)
    if sendThisMail:
        mailContentUtf8=mailContent.encode('utf-8','ignore')
        subjectTileUtf8=subjectTitle.encode('utf-8','ignore')
# def send_mail(to_list,sub,content)
        #print "subjectTileUtf8",subjectTileUtf8
        #print "mailContentUtf8",mailContentUtf8
        sendemail.send_mail(mailList,subjectTileUtf8,mailContentUtf8)
    time.sleep(20)
Example #4
0
from usps import download_files
from sendemail import send_mail
import os

files = download_files()
if files:
    send_mail(files)

    for f in files:
        os.remove(f)