Consistent quotes

This commit is contained in:
enkore 2013-02-15 18:38:18 +01:00
parent 922ae49aba
commit 561e60efee
3 changed files with 22 additions and 24 deletions

View File

@ -32,7 +32,7 @@ class I3statusHandler:
def print_line(self, message): def print_line(self, message):
"""Unbuffered printing to stdout.""" """Unbuffered printing to stdout."""
sys.stdout.write(message + '\n') sys.stdout.write(message + "\n")
sys.stdout.flush() sys.stdout.flush()
def read_line(self): def read_line(self):
@ -61,11 +61,11 @@ class I3statusHandler:
module.thread.start() module.thread.start()
while True: while True:
line, prefix = self.read_line(), '' line, prefix = self.read_line(), ""
# ignore comma at start of lines # ignore comma at start of lines
if line.startswith(','): if line.startswith(","):
line, prefix = line[1:], ',' line, prefix = line[1:], ","
j = json.loads(line) j = json.loads(line)

View File

@ -13,23 +13,23 @@ status = I3statusHandler()
# The imap checker module # The imap checker module
mailsettings = { mailsettings = {
'color': '#ff0000', "color": "#ff0000",
'servers': [ "servers": [
{ {
'host': 'www.testhost1.com', "host": "www.testhost1.com",
'port': '993', "port": "993",
'ssl' : True, "ssl" : True,
'username': 'your_username', "username": "your_username",
'password': 'your_password', "password": "your_password",
'pause': 20 "pause": 20
}, },
{ {
'host': 'www.testhost2.net', "host": "www.testhost2.net",
'port': '993', "port": "993",
'ssl' : True, "ssl" : True,
'username': 'your_username', "username": "your_username",
'password': 'your_password', "password": "your_password",
'pause': 20 "pause": 20
} }
] ]
} }
@ -38,14 +38,14 @@ status.register_module(mailchecker)
# the mods.de forum new bookmarks module # the mods.de forum new bookmarks module
mdesettings = { mdesettings = {
'username': "your_username", "username": "your_username",
'password': "your_password" "password": "your_password"
} }
mde = modsde.ModsDeChecker(mdesettings) mde = modsde.ModsDeChecker(mdesettings)
status.register_module(mde) status.register_module(mde)
# the notmuch mail checker module # the notmuch mail checker module
db_path = 'path_to_your_notmuch_database' db_path = "path_to_your_notmuch_database"
notmuch = notmuchmailchecker.NotmuchMailChecker(db_path) notmuch = notmuchmailchecker.NotmuchMailChecker(db_path)
status.register_module(notmuch) status.register_module(notmuch)

View File

@ -29,8 +29,6 @@ class ModsDeChecker(Module):
settings = { settings = {
"color": "#7181fe", "color": "#7181fe",
"pause": 20, "pause": 20,
"username": "",
"password": "",
"offset": 0, "offset": 0,
"format": "%d new posts in bookmarks" "format": "%d new posts in bookmarks"
} }
@ -86,5 +84,5 @@ class ModsDeChecker(Module):
for cookie in self.cj: for cookie in self.cj:
self.cj.clear self.cj.clear
self.logged_in = True self.logged_in = True
self.opener.addheaders.append(('Cookie', '{}={}'.format(cookie.name, cookie.value))) self.opener.addheaders.append(("Cookie", "{}={}".format(cookie.name, cookie.value)))
return True return True