def __init__(self, doc_id=-1, siteurl ='', domain=''): threading.Thread.__init__(self); self.site = Site(); self.site.url = siteurl; self.site.domain = domain; self.doc_id = doc_id; self.myDBConn = databaseConn();
def getNewDBHnd(): dbHnd = databaseConn("staz", "adadadad", "staz") return dbHnd
import myLogger; import Configuration; import datetime; from databaseConn import databaseConn; #### GLOBAL DATA###### myDBConn = databaseConn(); #### MAIN METHOD #### if __name__ == '__main__': _oLog = myLogger.myLogger(moduleName="url_assign_log"); _oLog.info("Started parsing out new URLs"); now = datetime.datetime.now(); date = now.strftime('%Y%m%d'); if(Configuration.getSetting('override_date', '') != ''): date = Configuration.getSetting('override_date', date); try: datetime.strptime(date, "%Y%m%d"); except: _oLog.error("Parsing date is not a valid date. Must be in format: yyyyMMdd"); _oLog.info("Running URL Assign on date: " + str(date)); file = Configuration.getSetting("url_handoff", "C:\\UUMMUU_Code\\Logs\\"+str(date)[0:6]+"\\LINKED_URLS_LOG\\linked_urls_log_"+str(date)+'.log'); try: opened_file = open(file); except: _oLog.info("File is not ready to be parsed. Exiting..."); exit();