Beispiel #1
0
						eh_sk = cursor.fetchone()[0]

					except cursor.Error, e:
						try:   
							e.args[1].find("Duplicate")
						except:
							print "Error %d: %s" % (e.args[0],e.args[1])
							print "Failed to insert extract history value: "+str(cik)
						continue



					try:
                                                if html_fn != "none":
                                                        try:
                                                                html_result = html_load_gaap.html_load(html_fn, name, cik, file_date, form, symbol, eh_sk)
                                                        except:
                                                                pass


						fulfill_html.fulfill(file_date,0,0,form,company_sk,eh_sk)
						#Tweet about it
						if symbol != "NA":
							try:
								tweet.tweet(name, exchange, symbol, form)
							except:
								"no tweets!"

					except:
						print "no html fulfill for you! "+company_sk, name, symbol, form
Beispiel #2
0
					try:
						e.args[1].find("Duplicate")
					except:
						print "Error %d: %s" % (e.args[0],e.args[1])
						print "failed to insert company info: "+",".join(map(str,[company, cik, industry, industry_id, corp_state, address_line_1, address_line_2, city, state, zip]))
					continue





			# try to parse and load it
			try:
				print "Loading HTML"
				print "html_load_gaap.html_load("+name, str(cik), file_date, form, symbol, str(eh_sk)
				html_result = html_load_gaap.html_load(name, str(cik), file_date, form, symbol, str(eh_sk))
				print 'loaded!'
			except:
				print "Died in HTML Load for "+name
				print "No PARSED data for "+name
				#break
				
			try:
				print "xbrl = "+str(xbrl)
				print "txt_name "+txt_name
				if xbrl == 1:	
					clean_xbrl_fn = cleanse.cleanse(xbrl_fn,symbol)
					result = xbrl_load_quarter.xbrl_load(clean_xbrl_fn, name, cik, file_date, form, symbol, str(eh_sk))		
				else: 
					print "no xbrl for "+txt_name
			except: