def __init__(self): self._pSend = sendMail.pageSender() self._pLoader = pageLoader() self.pageDir = configLoader.conf.getValue('pageDir') #"pages/" self.mailDir = configLoader.conf.getValue('mailDir') #"mails/" self.mailBackupDir = configLoader.conf.getValue('mailBackupDir') #"mails_back/" self.backupMails = configLoader.conf.getValue('backupMails') self.maxLinksPerMail = configLoader.conf.getValue('maxLinksPerMail') #2 self.HEADERS = "From To Subject".split() # headers you're actually interested in self.rx_headers = re.compile('|'.join(self.HEADERS), re.IGNORECASE) self.rx_from = re.compile('From', re.IGNORECASE) self.rx_subject = re.compile('Subject', re.IGNORECASE) #self.rx_findLinks = re.compile('(((news|(ht|f)tp(s?))\://){1}\S+)', re.IGNORECASE) self.rx_findLinks = re.compile('((http|ftp|https):\/\/[\w\-_]+(\.[\w\-_]+)+([\w\-\.,@?^=%&:/~\+#]*[\w\-\@?^=%&/~\+#])?)', re.IGNORECASE) self.version = '0.2'
#!/usr/bin/env python if __name__ == "__main__": import configLoader print( 'configs loaded: ' + str(len(configLoader.conf.configDic))) print( configLoader.conf.getValue("maxLines", 23) ) print( configLoader.conf.getValue("nf", "nf") ) from modules.pageLoader import pageLoader pg = pageLoader() print pg.getPlainContent('http://blog.fefe.de')