Skip to content

Commit

Permalink
pep8
Browse files Browse the repository at this point in the history
  • Loading branch information
bernardopires committed Jan 14, 2015
1 parent 27d3ca3 commit 1b28972
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 4 deletions.
1 change: 0 additions & 1 deletion __init__.py
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@

1 change: 0 additions & 1 deletion bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,3 @@ def command_patterns(self):
return (
('.*', self.log),
)

2 changes: 1 addition & 1 deletion db_logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

from utils import current_time_in_milli


class DatabaseLogger:
conn = None
cursor = None
Expand All @@ -21,4 +22,3 @@ def log(self, sender, message, channel):
except psycopg2.DataError as e:
print e
print message

1 change: 1 addition & 0 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from utils import get_top_channels
from db_logger import DatabaseLogger


def main():
conn = IRCConnection(settings.IRC['SERVER'],
settings.IRC['PORT'],
Expand Down
3 changes: 2 additions & 1 deletion utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@
import requests
import time


def get_top_channels(n):
twitch_api_url = 'https://api.twitch.tv/kraken/streams/?limit=%i' % n
streams = json.loads(requests.get(twitch_api_url).text)['streams']
return [stream['channel']['name'] for stream in streams]


def current_time_in_milli():
return int(round(time.time() * 1000))

0 comments on commit 1b28972

Please sign in to comment.