Skip to content

Commit

Permalink
pep-8 compliance
Browse files Browse the repository at this point in the history
  • Loading branch information
ytjohn committed Aug 30, 2012
1 parent 799dcb2 commit 36b7bd4
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions demos/pycket/pycketdemo.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ def __init__(self):
settings['pycket'] = {
'engine': 'redis',
'storage': {
'host' : 'localhost',
'port' : 6379,
'db_sessions' : 10,
'db_notifications' : 11,
}
'host': 'localhost',
'port': 6379,
'db_sessions': 10,
'db_notifications': 11
}
}

cyclone.web.Application.__init__(self, handlers, **settings)
Expand All @@ -73,13 +73,17 @@ def get(self):
class AuthHandler(BaseHandler, SessionMixin):

def get(self):
self.write('<form method="post">Enter your username: <input name="username" type="text"><button type="submit" class="btn">Login</button></form>')

self.write('<form method="post">'
'Enter your username: <input name="username" type="text">'
'<button type="submit" class="btn">Login</button></form>')

def post(self):
username = self.get_argument('username')
if not username:
self.write('<form method="post">Enter your username: <input name="username" type="text"><button type="submit" class="btn">Login</button></form>')
self.write('<form method="post">Enter your username: '
'<input name="username" type="text">'
'<button type="submit" class="btn">Login</button>'
'</form>')
else:
self.session.set('user', username)
self.redirect('/')
Expand Down

0 comments on commit 36b7bd4

Please sign in to comment.