]> git.cworth.org Git - turbot/blobdiff - turbot.py
Fix some code style issues identified by flake8
[turbot] / turbot.py
index 4a6aaffa8b614abe9a659eaece897ffbe133dcb2..4224d429ca0ee996d8424f476cb3d3b8d248b7d6 100755 (executable)
--- a/turbot.py
+++ b/turbot.py
@@ -42,7 +42,7 @@ def rot():
     This implements the /rot command of our Slack bot. The format of this
     command is as follows:
 
-       /rot [count|*] String to be rotated
+        /rot [count|*] String to be rotated
 
     The optional count indicates an amount to rotate each character in the
     string. If the count is '*' or is not present, then the string will
@@ -54,8 +54,8 @@ def rot():
     in a direct message that it is not a member of. Otherwise, if the slash
     command was issued in a channel, the bot will reply in that channel."""
 
-    data = request.get_data();
-    headers = request.headers;
+    data = request.get_data()
+    headers = request.headers
     response_url = request.form.get('response_url')
     channel_name = request.form.get('channel_name')
     channel = request.form.get('channel_id')
@@ -68,7 +68,7 @@ def rot():
     if (match):
         try:
             count = int(match.group(1))
-        except:
+        except ValueError:
             count = None
         text = match.group(2)
     else:
@@ -82,7 +82,8 @@ def rot():
     if count:
         reply += rot_string(text, count)
     else:
-        reply += "\n".join(["{:02d} ".format(count) + rot_string(text, count) for count in range(1,26)])
+        reply += "\n".join(["{:02d} ".format(count) + rot_string(text, count)
+                            for count in range(1, 26)])
 
     reply += "```"