Exemple #1
0
def test_acct(acct):
    status, ofxfile = ofx.getOFX(acct,31)
    if  status:
        print 'Download completed successfully\n\n'
        test = raw_input('Send the results to Money (y/n)? ').upper()
        if test=='Y':
            rlib1.runFile(ofxfile)
            raw_input('Press Enter to continue...')
    else:
        print 'An online error occurred while testing the new account.'
        #create process Queue in the right order
        Queue = ['Accts']
        if userdat.savetickersfirst:
            Queue.insert(0,'Quotes')
        else:
            Queue.append('Quotes')

        for QEntry in Queue:

            if QEntry == 'Accts':
               if len(AcctArray) == 0:
                  print "No accounts have been configured. Run SETUP.PY to add accounts"

               #process accounts
               for acct in AcctArray:
                  status, ofxFile = ofx.getOFX(acct, interval)
                  #status == False if ofxFile doesn't exist
                  stat1 = stat1 and status
                  if status: 
                     ofxList.append([acct[0], acct[1], ofxFile])
                  print ""
                        
            #get stock/fund quotes
            if QEntry == 'Quotes' and getquotes:
                status, quoteFile1, quoteFile2, htmFileName = quotes.getQuotes()
                z = ['Stock/Fund Quotes','',quoteFile1]
                stat1 = stat1 and status
                if glob.glob(quoteFile1) <> []: 
                    ofxList.append(z)
                print ""
Exemple #3
0
            Queue.append('Quotes')

        for QEntry in Queue:

            if QEntry == 'Accts':
                if len(AcctArray) == 0:
                    print(
                        "No accounts have been configured. Run SETUP.PY to add accounts"
                    )

                #process accounts
                badConnects = [
                ]  #track [sitename, username] for failed connections so we don't risk locking an account
                for acct in AcctArray:
                    if [acct[0], acct[3]] not in badConnects:
                        status, ofxFile = ofx.getOFX(acct, interval)
                        if not status and userdat.skipFailedLogon:
                            badConnects.append([acct[0], acct[3]])
                        else:
                            ofxList.append([acct[0], acct[1], ofxFile])
                        stat1 = stat1 and status
                        print("")

            if QEntry == 'importFiles':
                #process files from import folder [manual user downloaded files]
                #include anything that looks like a valid ofx file regardless of extension
                #attempts to find site entry by FID found in the ofx file

                print('Searching %s for statements to import' % importdir)
                for f in glob.glob(importdir + '*.*'):
                    fname = os.path.basename(f)  #full base filename.extension