diff --git a/README.md b/README.md index 37347a5..0f56bb3 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ Change your i3wm config to the following: # i3bar bar { - status_command i3status | python2 ~/.config/i3status/contrib/wrapper.py + status_command i3status | python ~/.config/i3status/contrib/wrapper.py position top workspace_buttons yes } @@ -32,6 +32,15 @@ Change your i3wm config to the following: And finally adjust the settings in `~/.config/i3status/contrib/wrapper.py` as you like. +## Modules + +### thunderbirdnewmail + +Requires + +* python-dbus +* python-gobject2 + ## Contribute To contribute a script, make sure it has a function `output()` that outputs @@ -39,4 +48,5 @@ valid json code that can be interpreted by i3status. The protocol is documented here: [i3status Protocol](http://i3wm.org/docs/i3bar-protocol.html). Please add an example for how to configure it to `wrapper.py.dist`. It should be -a python class that can be registered with the `I3StatusHandler` class. \ No newline at end of file +a python class that can be registered with the `I3StatusHandler` class. + diff --git a/mailchecker.py b/mailchecker.py index 721a5f5..f367336 100644 --- a/mailchecker.py +++ b/mailchecker.py @@ -87,7 +87,7 @@ class MailChecker(object): try: self.connection.select() - except Exception,e: + except Exception as e: self.connection = None return self.connection diff --git a/modsde.py b/modsde.py index ce89a97..54bd149 100644 --- a/modsde.py +++ b/modsde.py @@ -3,9 +3,9 @@ import sys import json from datetime import datetime,timedelta -import urllib, urllib2 +import urllib.request, urllib.parse, urllib.error, urllib.request, urllib.error, urllib.parse import re -import cookielib +import http.cookiejar import xml.etree.ElementTree as ET class ModsDeChecker: @@ -31,11 +31,11 @@ class ModsDeChecker: def __init__(self, settings = None): self.settings.update(settings) - self.cj = cookielib.CookieJar() + self.cj = http.cookiejar.CookieJar() self.last_checked = \ datetime.now() - timedelta(seconds=self.settings['pause']) - self.opener = urllib2.build_opener( - urllib2.HTTPCookieProcessor(self.cj)) + self.opener = urllib.request.build_opener( + urllib.request.HTTPCookieProcessor(self.cj)) def get_unread_count(self): delta = datetime.now() - self.last_checked @@ -54,8 +54,8 @@ class ModsDeChecker: self.unread_cache = int(root.attrib['newposts']) except Exception: self.cj.clear() - self.opener = urllib2.build_opener( - urllib2.HTTPCookieProcessor(self.cj)) + self.opener = urllib.request.build_opener( + urllib.request.HTTPCookieProcessor(self.cj)) self.logged_in = False return self.unread_cache @@ -63,7 +63,7 @@ class ModsDeChecker: def login(self): - data = urllib.urlencode({ + data = urllib.parse.urlencode({ "login_username": self.settings["username"], "login_password": self.settings["password"], "login_lifetime": "31536000" diff --git a/statushandler.py b/statushandler.py index ef29007..aba6cd7 100644 --- a/statushandler.py +++ b/statushandler.py @@ -2,7 +2,7 @@ import sys import json -import urllib2 +import urllib.request, urllib.error, urllib.parse class I3statusHandler: modules = [] @@ -66,7 +66,7 @@ class I3statusHandler: def has_internet_connection(): try: - response=urllib2.urlopen('http://74.125.113.99',timeout=1) + response=urllib.request.urlopen('http://74.125.113.99',timeout=1) return True - except urllib2.URLError as err: pass + except urllib.error.URLError as err: pass return False \ No newline at end of file