PEP8 style fixes for HTTPInterface

pull/2/head
Paulus Schoutsen 2014-01-29 22:59:19 -08:00
parent e586d8debc
commit 416816cef7
1 changed files with 61 additions and 62 deletions

View File

@ -265,20 +265,20 @@ class RequestHandler(BaseHTTPRequestHandler):
"<html>"
"<head><title>Home Assistant</title>"
"<link rel='stylesheet' type='text/css' "
"href='/static/style.css'>"
" href='/static/style.css'>"
"<link rel='icon' href='/static/favicon.ico' "
"type='image/x-icon' />"
" type='image/x-icon' />"
"</head>"
"<body>"
"<div class='container'>"
"<form class='form-signin' action='{}' method='GET'>"
"<input type='text' class='form-control' name='api_password' "
"placeholder='API Password for Home Assistant' "
"required autofocus>"
" placeholder='API Password for Home Assistant' "
" required autofocus>"
"<button class='btn btn-lg btn-primary btn-block' "
"type='submit'>Enter</button>"
" type='submit'>Enter</button>"
"</form>"
"</div>"
@ -299,14 +299,13 @@ class RequestHandler(BaseHTTPRequestHandler):
write(("<html>"
"<head><title>Home Assistant</title>"
"<link rel='stylesheet' type='text/css' "
"href='/static/style.css'>"
" href='/static/style.css'>"
"<link rel='icon' href='/static/favicon.ico' "
"type='image/x-icon' />"
" type='image/x-icon' />"
"</head>"
"<body>"
"<div class='container'>"
"<div class='page-header'><h1>Home Assistant</h1></div>"
))
"<div class='page-header'><h1>Home Assistant</h1></div>"))
# Flash message support
if self.server.flash_message:
@ -321,9 +320,9 @@ class RequestHandler(BaseHTTPRequestHandler):
"<div class='col-xs-12'>"
"<div class='panel panel-primary'>"
"<div class='panel-heading'><h2 class='panel-title'>"
"States</h2></div>"
" States</h2></div>"
"<form method='post' action='/change_state' "
"class='form-change-state'>"
" class='form-change-state'>"
"<input type='hidden' name='api_password' value='{}'>"
"<table class='table'><tr>"
"<th>Entity ID</th><th>State</th>"
@ -350,14 +349,14 @@ class RequestHandler(BaseHTTPRequestHandler):
# Change state form
write(("<tr><td><input name='entity_id' class='form-control' "
"placeholder='Entity ID'></td>"
" placeholder='Entity ID'></td>"
"<td><input name='new_state' class='form-control' "
"placeholder='New State'></td>"
" placeholder='New State'></td>"
"<td><textarea rows='3' name='attributes' class='form-control' "
"placeholder='State Attributes (JSON, optional)'>"
"</textarea></td>"
" placeholder='State Attributes (JSON, optional)'>"
"</textarea></td>"
"<td><button type='submit' class='btn btn-default'>"
"Set State</button></td></tr>"
"Set State</button></td></tr>"
"</table></form></div>"
@ -368,7 +367,7 @@ class RequestHandler(BaseHTTPRequestHandler):
"<div class='col-xs-6'>"
"<div class='panel panel-primary'>"
"<div class='panel-heading'><h2 class='panel-title'>"
"Services</h2></div>"
" Services</h2></div>"
"<table class='table'>"
"<tr><th>Domain</th><th>Service</th></tr>"))
@ -382,45 +381,45 @@ class RequestHandler(BaseHTTPRequestHandler):
"<div class='col-xs-6'>"
"<div class='panel panel-primary'>"
"<div class='panel-heading'><h2 class='panel-title'>"
"Call Service</h2></div>"
" Call Service</h2></div>"
"<div class='panel-body'>"
"<form method='post' action='/call_service' "
"class='form-horizontal form-fire-event'>"
" class='form-horizontal form-fire-event'>"
"<input type='hidden' name='api_password' value='{}'>"
"<div class='form-group'>"
"<label for='domain' class='col-xs-3 control-label'>"
"Domain</label>"
"<div class='col-xs-9'>"
"<input type='text' class='form-control' id='domain'"
" name='domain' placeholder='Service Domain'>"
"</div>"
" <label for='domain' class='col-xs-3 control-label'>"
" Domain</label>"
" <div class='col-xs-9'>"
" <input type='text' class='form-control' id='domain'"
" name='domain' placeholder='Service Domain'>"
" </div>"
"</div>"
"<div class='form-group'>"
"<label for='service' class='col-xs-3 control-label'>"
"Service</label>"
"<div class='col-xs-9'>"
"<input type='text' class='form-control' id='service'"
" name='service' placeholder='Service name'>"
"</div>"
" <label for='service' class='col-xs-3 control-label'>"
" Service</label>"
" <div class='col-xs-9'>"
" <input type='text' class='form-control' id='service'"
" name='service' placeholder='Service name'>"
" </div>"
"</div>"
"<div class='form-group'>"
"<label for='service_data' class='col-xs-3 control-label'>"
"Service data</label>"
"<div class='col-xs-9'>"
"<textarea rows='3' class='form-control' id='service_data'"
" name='service_data' placeholder='Service Data "
"(JSON, optional)'></textarea>"
"</div>"
" <label for='service_data' class='col-xs-3 control-label'>"
" Service data</label>"
" <div class='col-xs-9'>"
" <textarea rows='3' class='form-control' id='service_data'"
" name='service_data' placeholder='Service Data "
"(JSON, optional)'></textarea>"
" </div>"
"</div>"
"<div class='form-group'>"
"<div class='col-xs-offset-3 col-xs-9'>"
"<button type='submit' class='btn btn-default'>"
"Call Service</button>"
"</div>"
" <div class='col-xs-offset-3 col-xs-9'>"
" <button type='submit' class='btn btn-default'>"
" Call Service</button>"
" </div>"
"</div>"
"</form>"
"</div></div></div>"
@ -431,7 +430,7 @@ class RequestHandler(BaseHTTPRequestHandler):
"<div class='col-xs-6'>"
"<div class='panel panel-primary'>"
"<div class='panel-heading'><h2 class='panel-title'>"
"Events</h2></div>"
" Events</h2></div>"
"<table class='table'>"
"<tr><th>Event</th><th>Listeners</th></tr>"))
@ -445,36 +444,36 @@ class RequestHandler(BaseHTTPRequestHandler):
"<div class='col-xs-6'>"
"<div class='panel panel-primary'>"
"<div class='panel-heading'><h2 class='panel-title'>"
"Fire Event</h2></div>"
" Fire Event</h2></div>"
"<div class='panel-body'>"
"<form method='post' action='/fire_event' "
"class='form-horizontal form-fire-event'>"
" class='form-horizontal form-fire-event'>"
"<input type='hidden' name='api_password' value='{}'>"
"<div class='form-group'>"
"<label for='event_type' class='col-xs-3 control-label'>"
"Event type</label>"
"<div class='col-xs-9'>"
"<input type='text' class='form-control' id='event_type'"
" name='event_type' placeholder='Event Type'>"
"</div>"
" <label for='event_type' class='col-xs-3 control-label'>"
" Event type</label>"
" <div class='col-xs-9'>"
" <input type='text' class='form-control' id='event_type'"
" name='event_type' placeholder='Event Type'>"
" </div>"
"</div>"
"<div class='form-group'>"
"<label for='event_data' class='col-xs-3 control-label'>"
"Event data</label>"
"<div class='col-xs-9'>"
"<textarea rows='3' class='form-control' id='event_data'"
" name='event_data' placeholder='Event Data "
"(JSON, optional)'></textarea>"
"</div>"
" <label for='event_data' class='col-xs-3 control-label'>"
" Event data</label>"
" <div class='col-xs-9'>"
" <textarea rows='3' class='form-control' id='event_data'"
" name='event_data' placeholder='Event Data "
"(JSON, optional)'></textarea>"
" </div>"
"</div>"
"<div class='form-group'>"
"<div class='col-xs-offset-3 col-xs-9'>"
"<button type='submit' class='btn btn-default'>"
"Fire Event</button>"
"</div>"
" <div class='col-xs-offset-3 col-xs-9'>"
" <button type='submit' class='btn btn-default'>"
" Fire Event</button>"
" </div>"
"</div>"
"</form>"
"</div></div></div>"