Ori.livneh has uploaded a new change for review. https://gerrit.wikimedia.org/r/233035
Change subject: Make util.py PEP8-compliant ...................................................................... Make util.py PEP8-compliant Change-Id: Ic658783d26430db3408ec76a7f88888afb5994a5 --- M pybal/util.py 1 file changed, 8 insertions(+), 9 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/debs/pybal refs/changes/35/233035/1 diff --git a/pybal/util.py b/pybal/util.py index 78b2062..0c4a95d 100644 --- a/pybal/util.py +++ b/pybal/util.py @@ -4,21 +4,20 @@ LVS Squid balancer/monitor for managing the Wikimedia Squid servers using LVS """ +import sys +import datetime -import sys, datetime class LogFile(object): def __init__(self, filename): self.filename = filename self.lineEnded = True - self.file = file(filename, 'a') - + def write(self, s): """ Write string to logfile with a timestamp """ - lines = s.splitlines(True) for line in lines: if self.lineEnded: @@ -28,18 +27,18 @@ self.lineEnded = line.endswith('\n') self.file.flush() - + def reopen(self): """ Close the logfile and reopen it. Useful for log rotation. """ - self.file.close() self.file = file(self.filename, 'a') self.lineEnded = True + class ConfigDict(dict): - + def getint(self, key, default=None): try: return int(self[key]) @@ -49,7 +48,7 @@ else: raise # do not intercept ValueError - + def getboolean(self, key, default=None): try: value = self[key] @@ -68,7 +67,7 @@ return False else: raise ValueError - + def getfloat(self, key, default=None): try: return float(self[key]) -- To view, visit https://gerrit.wikimedia.org/r/233035 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic658783d26430db3408ec76a7f88888afb5994a5 Gerrit-PatchSet: 1 Gerrit-Project: operations/debs/pybal Gerrit-Branch: master Gerrit-Owner: Ori.livneh <o...@wikimedia.org> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits