fixed some awkward shiet

This commit is contained in:
panki27 2017-11-16 00:00:27 +01:00
parent 70945bcca7
commit 63c98b8ff4

View File

@ -1,6 +1,5 @@
#!/usr/bin/env python #!/usr/bin/env python
import datetime, sys, re, urllib2, logging import datetime, sys, re, urllib2, logging
#from pushnotify import abstract, get_client, exceptions, pushover
import pushnotify import pushnotify
from bs4 import BeautifulSoup from bs4 import BeautifulSoup
@ -28,7 +27,7 @@ class Advisory:
self.date = datetime.datetime.strptime(html.td.text, '%d.%m.%y').date() self.date = datetime.datetime.strptime(html.td.text, '%d.%m.%y').date()
self.risk = int(html.find('span', {'class': re.compile('search-result-crit-*')}).text) self.risk = int(html.find('span', {'class': re.compile('search-result-crit-*')}).text)
self.identifier = html.find('a', {'class': 'search-result-link'}).text self.identifier = html.find('a', {'class': 'search-result-link'}).text
self.link = 'https://www.cert-bund.de/overview/' + html.find('a', {'class': 'search-result-link'})['href'] self.link = 'https://www.cert-bund.de/' + html.find('a', {'class': 'search-result-link'})['href']
self.description = html.find_all('a', {'class': 'search-result-link'})[1].text self.description = html.find_all('a', {'class': 'search-result-link'})[1].text
def debug(self): def debug(self):
print('date: '+ self.date.isoformat()) print('date: '+ self.date.isoformat())
@ -39,7 +38,7 @@ class Advisory:
def startLogger(): def startLogger():
logger = logging.getLogger('pushnotify') logger = logging.getLogger('pushnotify')
logger.setLevel(logging.DEBUG)F logger.setLevel(logging.DEBUG)
formatter = logging.Formatter('%(name)s-%(levelname)s: %(message)s') formatter = logging.Formatter('%(name)s-%(levelname)s: %(message)s')
handler = logging.StreamHandler() handler = logging.StreamHandler()
handler.setFormatter(formatter) handler.setFormatter(formatter)