Skip to content

Commit 66f22cc

Browse files
committedJan 12, 2015
flake8
Signed-off-by: Chris Warrick <kwpolska@gmail.com>
1 parent 17c69cf commit 66f22cc

File tree

3 files changed

+21
-11
lines changed

3 files changed

+21
-11
lines changed
 

‎comet/init.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131

3232
__all__ = ['init', 'write_users']
3333

34+
3435
def init():
3536
print("ERROR: Not implemented.")
3637
return 255
@@ -40,7 +41,8 @@ def write_users(dburl):
4041
data = {
4142
'username': 'admin',
4243
'realname': 'Website Administrator',
43-
'password': '$2a$12$.qMCcA2uOo0BKkDtEF/bueYtHjcdPBmfEdpxtktRwRTgsR7ZVTWmW',
44+
'password':
45+
'$2a$12$.qMCcA2uOo0BKkDtEF/bueYtHjcdPBmfEdpxtktRwRTgsR7ZVTWmW',
4446
}
4547

4648
for p in PERMISSIONS:

‎comet/utils.py

+10-5
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@
3030
import sys
3131

3232

33-
__all__ = ['PERMISSIONS', 'USER_FIELDS', 'USER_ALL', 'parse_redis', 'ask', 'ask_yesno']
33+
__all__ = ['PERMISSIONS', 'USER_FIELDS', 'USER_ALL', 'parse_redis', 'ask',
34+
'ask_yesno']
3435

3536
USER_FIELDS = ['username', 'realname', 'password', 'email']
3637
PERMISSIONS = ['active', 'is_admin', 'can_edit_all_posts', 'wants_all_posts',
@@ -67,9 +68,11 @@ def ask(query, default=None):
6768
else:
6869
default_q = ''
6970
if sys.version_info[0] == 3:
70-
inp = raw_input("{query}{default_q}: ".format(query=query, default_q=default_q)).strip()
71+
inp = raw_input("{query}{default_q}: ".format(
72+
query=query, default_q=default_q)).strip()
7173
else:
72-
inp = raw_input("{query}{default_q}: ".format(query=query, default_q=default_q).encode('utf-8')).strip()
74+
inp = raw_input("{query}{default_q}: ".format(
75+
query=query, default_q=default_q).encode('utf-8')).strip()
7376
if inp or default is None:
7477
return inp
7578
else:
@@ -85,9 +88,11 @@ def ask_yesno(query, default=None):
8588
elif default is False:
8689
default_q = ' [y/N]'
8790
if sys.version_info[0] == 3:
88-
inp = raw_input("{query}{default_q} ".format(query=query, default_q=default_q)).strip()
91+
inp = raw_input("{query}{default_q} ".format(
92+
query=query, default_q=default_q)).strip()
8993
else:
90-
inp = raw_input("{query}{default_q} ".format(query=query, default_q=default_q).encode('utf-8')).strip()
94+
inp = raw_input("{query}{default_q} ".format(
95+
query=query, default_q=default_q).encode('utf-8')).strip()
9196
if inp:
9297
return inp.lower().startswith('y')
9398
elif default is not None:

‎comet/web.py

+8-5
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
import pkg_resources
3333
import nikola.__main__
3434
import logbook
35-
import kombu
3635
import redis
3736
from nikola.utils import unicode_str, get_logger, ColorfulStderrHandler
3837
import nikola.plugins.command.new_post
@@ -140,10 +139,11 @@ def configure_site():
140139
<script src="/comet_assets/js/comet.js"></scripts>
141140
"""
142141

143-
# Theme must inherit from bootstrap3, because we have hardcoded HTML for that.
142+
# Theme must inherit from bootstrap3, because we have hardcoded HTML.
144143
bs3 = ('bootstrap3' in site.THEMES) or ('bootstrap3-jinja' in site.THEMES)
145144
if not bs3:
146-
app.logger.notice("THEME does not inherit from 'bootstrap3' or 'bootstrap3-jinja', using 'bootstrap3' instead.")
145+
app.logger.notice("THEME does not inherit from 'bootstrap3' or "
146+
"'bootstrap3-jinja', using 'bootstrap3' instead.")
147147
site.config['THEME'] = 'bootstrap3'
148148
# Reloading some things
149149
site._THEMES = None
@@ -297,6 +297,7 @@ def find_post(path):
297297

298298
app = Flask('comet')
299299

300+
300301
@app.after_request
301302
def log_request(resp):
302303
"""Log a request."""
@@ -730,7 +731,8 @@ def acp_users_edit():
730731

731732
if action == 'new':
732733
if not data['username']:
733-
return error("No username to create specified.", 400, "/users/edit")
734+
return error("No username to create specified.", 400,
735+
"/users/edit")
734736
uid = db.incr('last_uid')
735737
pf = [False for p in PERMISSIONS]
736738
pf[0] = True # active
@@ -835,7 +837,8 @@ def display_permission(user, permission):
835837
if permission == 'wants_all_posts' and not user.can_edit_all_posts:
836838
# If this happens, permissions are damaged.
837839
checked = ''
838-
if user.uid == current_user.uid and permission in ['active', 'is_admin']:
840+
if user.uid == current_user.uid and permission in ['active',
841+
'is_admin']:
839842
disabled = 'disabled'
840843
else:
841844
disabled = ''

0 commit comments

Comments
 (0)
Please sign in to comment.