]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
Replace all tabs with spaces.
authorBen Darnell <bdarnell@beaker.local>
Wed, 17 Mar 2010 21:59:17 +0000 (14:59 -0700)
committerBen Darnell <bdarnell@beaker.local>
Wed, 17 Mar 2010 21:59:17 +0000 (14:59 -0700)
13 files changed:
demos/appengine/templates/archive.html
demos/appengine/templates/base.html
demos/appengine/templates/feed.xml
demos/blog/templates/archive.html
demos/blog/templates/base.html
demos/blog/templates/feed.xml
demos/chat/static/chat.js
demos/chat/templates/index.html
demos/facebook/templates/stream.html
tornado/epoll.c
website/markdown/extensions/toc.py
website/templates/base.html
website/templates/index.html

index 9f1699793cdc6824f728dfa6109f467be2d37c9a..dcca9511a48919ec28579363ad803d654298672a 100644 (file)
@@ -23,8 +23,8 @@
   <ul class="archive">
     {% for entry in entries %}
       <li>
-       <div class="title"><a href="/entry/{{ entry.slug }}">{{ escape(entry.title) }}</a></div>
-       <div class="date">{{ locale.format_date(entry.published, full_format=True, shorter=True) }}</div>
+        <div class="title"><a href="/entry/{{ entry.slug }}">{{ escape(entry.title) }}</a></div>
+        <div class="date">{{ locale.format_date(entry.published, full_format=True, shorter=True) }}</div>
       </li>
     {% end %}
   </ul>
index 15cbf540430b9209b60c72b06833f206fb8bfee7..0154aea8ca5d537472f354e57e8faf41f92a153b 100644 (file)
   <body>
     <div id="body">
       <div id="header">
-       <div style="float:right">
-         {% if not current_user %}
-           {{ _('<a href="%(url)s">Sign in</a> to compose/edit') % {"url": escape(users.create_login_url(request.uri))} }}
-         {% else %}
-           {% if current_user.administrator %}
-             <a href="/compose">{{ _("New post") }}</a> -
-           {% end %}
-           <a href="{{ escape(users.create_logout_url(request.uri)) }}">{{ _("Sign out") }}</a>
-         {% end %}
-       </div>
-       <h1><a href="/">{{ escape(handler.settings["blog_title"]) }}</a></h1>
+        <div style="float:right">
+          {% if not current_user %}
+            {{ _('<a href="%(url)s">Sign in</a> to compose/edit') % {"url": escape(users.create_login_url(request.uri))} }}
+          {% else %}
+            {% if current_user.administrator %}
+              <a href="/compose">{{ _("New post") }}</a> -
+            {% end %}
+            <a href="{{ escape(users.create_logout_url(request.uri)) }}">{{ _("Sign out") }}</a>
+          {% end %}
+        </div>
+        <h1><a href="/">{{ escape(handler.settings["blog_title"]) }}</a></h1>
       </div>
       <div id="content">{% block body %}{% end %}</div>
     </div>
index 98a9298029195f0edbdf8e40eca4f8f4335784e5..c6c368656c70ee69d41d04a1351c841aa466023a 100644 (file)
@@ -19,7 +19,7 @@
       <updated>{{ entry.updated.strftime(date_format) }}</updated>
       <published>{{ entry.published.strftime(date_format) }}</published>
       <content type="xhtml" xml:base="http://{{ request.host }}/">
-       <div xmlns="http://www.w3.org/1999/xhtml">{{ entry.html }}</div>
+        <div xmlns="http://www.w3.org/1999/xhtml">{{ entry.html }}</div>
       </content>
     </entry>
   {% end %}
index 9f1699793cdc6824f728dfa6109f467be2d37c9a..dcca9511a48919ec28579363ad803d654298672a 100644 (file)
@@ -23,8 +23,8 @@
   <ul class="archive">
     {% for entry in entries %}
       <li>
-       <div class="title"><a href="/entry/{{ entry.slug }}">{{ escape(entry.title) }}</a></div>
-       <div class="date">{{ locale.format_date(entry.published, full_format=True, shorter=True) }}</div>
+        <div class="title"><a href="/entry/{{ entry.slug }}">{{ escape(entry.title) }}</a></div>
+        <div class="date">{{ locale.format_date(entry.published, full_format=True, shorter=True) }}</div>
       </li>
     {% end %}
   </ul>
index 4152037c04578d9b27f3d521c7b616b9189e62fe..038c5b3ffffc9ac0401c9815de05376a58274b3b 100644 (file)
   <body>
     <div id="body">
       <div id="header">
-       <div style="float:right">
-         {% if current_user %}
-           <a href="/compose">{{ _("New post") }}</a> -
-           <a href="/auth/logout?next={{ url_escape(request.uri) }}">{{ _("Sign out") }}</a>
-         {% else %}
-           {{ _('<a href="%(url)s">Sign in</a> to compose/edit') % {"url": "/auth/login?next=" + url_escape(request.uri)} }}
-         {% end %}
-       </div>
-       <h1><a href="/">{{ escape(handler.settings["blog_title"]) }}</a></h1>
+        <div style="float:right">
+          {% if current_user %}
+            <a href="/compose">{{ _("New post") }}</a> -
+            <a href="/auth/logout?next={{ url_escape(request.uri) }}">{{ _("Sign out") }}</a>
+          {% else %}
+            {{ _('<a href="%(url)s">Sign in</a> to compose/edit') % {"url": "/auth/login?next=" + url_escape(request.uri)} }}
+          {% end %}
+        </div>
+        <h1><a href="/">{{ escape(handler.settings["blog_title"]) }}</a></h1>
       </div>
       <div id="content">{% block body %}{% end %}</div>
     </div>
index 98a9298029195f0edbdf8e40eca4f8f4335784e5..c6c368656c70ee69d41d04a1351c841aa466023a 100644 (file)
@@ -19,7 +19,7 @@
       <updated>{{ entry.updated.strftime(date_format) }}</updated>
       <published>{{ entry.published.strftime(date_format) }}</published>
       <content type="xhtml" xml:base="http://{{ request.host }}/">
-       <div xmlns="http://www.w3.org/1999/xhtml">{{ entry.html }}</div>
+        <div xmlns="http://www.w3.org/1999/xhtml">{{ entry.html }}</div>
       </content>
     </entry>
   {% end %}
index f23a9dd931fd16824d9c1a9b02e4d0fe30f1c4ed..0054c710d63d01e7a4cbb9406ed957cdf3c319b6 100644 (file)
@@ -17,14 +17,14 @@ $(document).ready(function() {
     if (!window.console.log) window.console.log = function() {};
 
     $("#messageform").live("submit", function() {
-       newMessage($(this));
-       return false;
+        newMessage($(this));
+        return false;
     });
     $("#messageform").live("keypress", function(e) {
-       if (e.keyCode == 13) {
-           newMessage($(this));
-           return false;
-       }
+        if (e.keyCode == 13) {
+            newMessage($(this));
+            return false;
+        }
     });
     $("#message").select();
     updater.poll();
@@ -35,13 +35,13 @@ function newMessage(form) {
     var disabled = form.find("input[type=submit]");
     disabled.disable();
     $.postJSON("/a/message/new", message, function(response) {
-       updater.showMessage(response);
-       if (message.id) {
-           form.parent().remove();
-       } else {
-           form.find("input[type=text]").val("").select();
-           disabled.enable();
-       }
+        updater.showMessage(response);
+        if (message.id) {
+            form.parent().remove();
+        } else {
+            form.find("input[type=text]").val("").select();
+            disabled.enable();
+        }
     });
 }
 
@@ -53,10 +53,10 @@ function getCookie(name) {
 jQuery.postJSON = function(url, args, callback) {
     args._xsrf = getCookie("_xsrf");
     $.ajax({url: url, data: $.param(args), dataType: "text", type: "POST",
-           success: function(response) {
-       if (callback) callback(eval("(" + response + ")"));
+            success: function(response) {
+        if (callback) callback(eval("(" + response + ")"));
     }, error: function(response) {
-       console.log("ERROR:", response)
+        console.log("ERROR:", response)
     }});
 };
 
@@ -64,7 +64,7 @@ jQuery.fn.formToDict = function() {
     var fields = this.serializeArray();
     var json = {}
     for (var i = 0; i < fields.length; i++) {
-       json[fields[i].name] = fields[i].value;
+        json[fields[i].name] = fields[i].value;
     }
     if (json.next) delete json.next;
     return json;
@@ -89,47 +89,47 @@ var updater = {
     cursor: null,
 
     poll: function() {
-       var args = {"_xsrf": getCookie("_xsrf")};
-       if (updater.cursor) args.cursor = updater.cursor;
-       $.ajax({url: "/a/message/updates", type: "POST", dataType: "text",
-               data: $.param(args), success: updater.onSuccess,
-               error: updater.onError});
+        var args = {"_xsrf": getCookie("_xsrf")};
+        if (updater.cursor) args.cursor = updater.cursor;
+        $.ajax({url: "/a/message/updates", type: "POST", dataType: "text",
+                data: $.param(args), success: updater.onSuccess,
+                error: updater.onError});
     },
 
     onSuccess: function(response) {
-       try {
-           updater.newMessages(eval("(" + response + ")"));
-       } catch (e) {
-           updater.onError();
-           return;
-       }
-       updater.errorSleepTime = 500;
-       window.setTimeout(updater.poll, 0);
+        try {
+            updater.newMessages(eval("(" + response + ")"));
+        } catch (e) {
+            updater.onError();
+            return;
+        }
+        updater.errorSleepTime = 500;
+        window.setTimeout(updater.poll, 0);
     },
 
     onError: function(response) {
-       updater.errorSleepTime *= 2;
-       console.log("Poll error; sleeping for", updater.errorSleepTime, "ms");
-       window.setTimeout(updater.poll, updater.errorSleepTime);
+        updater.errorSleepTime *= 2;
+        console.log("Poll error; sleeping for", updater.errorSleepTime, "ms");
+        window.setTimeout(updater.poll, updater.errorSleepTime);
     },
 
     newMessages: function(response) {
-       if (!response.messages) return;
-       updater.cursor = response.cursor;
-       var messages = response.messages;
-       updater.cursor = messages[messages.length - 1].id;
-       console.log(messages.length, "new messages, cursor:", updater.cursor);
-       for (var i = 0; i < messages.length; i++) {
-           updater.showMessage(messages[i]);
-       }
+        if (!response.messages) return;
+        updater.cursor = response.cursor;
+        var messages = response.messages;
+        updater.cursor = messages[messages.length - 1].id;
+        console.log(messages.length, "new messages, cursor:", updater.cursor);
+        for (var i = 0; i < messages.length; i++) {
+            updater.showMessage(messages[i]);
+        }
     },
 
     showMessage: function(message) {
-       var existing = $("#m" + message.id);
-       if (existing.length > 0) return;
-       var node = $(message.html);
-       node.hide();
-       $("#inbox").append(node);
-       node.slideDown();
+        var existing = $("#m" + message.id);
+        if (existing.length > 0) return;
+        var node = $(message.html);
+        node.hide();
+        $("#inbox").append(node);
+        node.slideDown();
     }
 };
index cdd8658899f4f9123d42cf9f0a7a23e4dc0803ad..de051d852bb7c65c88003d4b60d6e5e2cdb32786 100644 (file)
     </div>
     <div id="body">
       <div id="inbox">
-       {% for message in messages %}
+        {% for message in messages %}
           {% include "message.html" %}
-       {% end %}
+        {% end %}
       </div>
       <div id="input">
-       <form action="/a/message/new" method="post" id="messageform">
-         <table>
-           <tr>
-             <td><input name="body" id="message" style="width:500px"/></td>
-             <td style="padding-left:5px">
-               <input type="submit" value="{{ _("Post") }}"/>
-               <input type="hidden" name="next" value="{{ request.path }}"/>
-               {{ xsrf_form_html() }}
-             </td>
-           </tr>
-         </table>
-       </form>
+        <form action="/a/message/new" method="post" id="messageform">
+          <table>
+            <tr>
+              <td><input name="body" id="message" style="width:500px"/></td>
+              <td style="padding-left:5px">
+                <input type="submit" value="{{ _("Post") }}"/>
+                <input type="hidden" name="next" value="{{ request.path }}"/>
+                {{ xsrf_form_html() }}
+              </td>
+            </tr>
+          </table>
+        </form>
       </div>
     </div>
     <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js" type="text/javascript"></script>
index 06ab1dfcb8588ece8ec5f80b60e95a76f19a3b1d..19baa28cbf013ad309f057a00cb645320d70e101 100644 (file)
@@ -8,14 +8,14 @@
   <body>
     <div id="body">
       <div style="float:right">
-       <b>{{ escape(current_user["name"]) }}</b> -
-       <a href="/auth/logout">{{ _("Sign out") }}</a>
+        <b>{{ escape(current_user["name"]) }}</b> -
+        <a href="/auth/logout">{{ _("Sign out") }}</a>
       </div>
       <div style="margin-bottom:1em"><a href="/">{{ _("Refresh stream") }}</a></div>
       <div id="stream">
-       {% for post in stream["posts"] %}
+        {% for post in stream["posts"] %}
           {{ modules.Post(post, stream["profiles"][post["actor_id"]]) }}
-       {% end %}
+        {% end %}
       </div>
     </div>
   </body>
index b87515429343b0b8dedd9a32691c922240ee9813..9a2e3a3747f7405d82eb9e74e91c9b8f240b4d6a 100644 (file)
@@ -26,8 +26,8 @@
 static PyObject* _epoll_create(void) {
     int fd = epoll_create(MAX_EVENTS);
     if (fd == -1) {
-       PyErr_SetFromErrno(PyExc_Exception);
-       return NULL;
+        PyErr_SetFromErrno(PyExc_Exception);
+        return NULL;
     }
 
     return PyInt_FromLong(fd);
@@ -50,8 +50,8 @@ static PyObject* _epoll_ctl(PyObject* self, PyObject* args) {
     event.events = events;
     event.data.fd = fd;
     if (epoll_ctl(epfd, op, fd, &event) == -1) {
-       PyErr_SetFromErrno(PyExc_OSError);
-       return NULL;
+        PyErr_SetFromErrno(PyExc_OSError);
+        return NULL;
     }
 
     Py_INCREF(Py_None);
@@ -77,16 +77,16 @@ static PyObject* _epoll_wait(PyObject* self, PyObject* args) {
     num_events = epoll_wait(epfd, events, MAX_EVENTS, timeout);
     Py_END_ALLOW_THREADS
     if (num_events == -1) {
-       PyErr_SetFromErrno(PyExc_Exception);
-       return NULL;
+        PyErr_SetFromErrno(PyExc_Exception);
+        return NULL;
     }
 
     list = PyList_New(num_events);
     for (i = 0; i < num_events; i++) {
-       tuple = PyTuple_New(2);
-       PyTuple_SET_ITEM(tuple, 0, PyInt_FromLong(events[i].data.fd));
-       PyTuple_SET_ITEM(tuple, 1, PyInt_FromLong(events[i].events));
-       PyList_SET_ITEM(list, i, tuple);
+        tuple = PyTuple_New(2);
+        PyTuple_SET_ITEM(tuple, 0, PyInt_FromLong(events[i].data.fd));
+        PyTuple_SET_ITEM(tuple, 1, PyInt_FromLong(events[i].events));
+        PyList_SET_ITEM(list, i, tuple);
     }
     return list;
 }
index 1624ccf64b90bd97b58208f4e4999405aa637329..3afaea04881b060d6f97fe672c1302f84c6b61a1 100644 (file)
@@ -135,6 +135,6 @@ class TocExtension(markdown.Extension):
         tocext = TocTreeprocessor(md)
         tocext.config = self.config
         md.treeprocessors.add("toc", tocext, "_begin")
-       
+        
 def makeExtension(configs={}):
     return TocExtension(configs=configs)
index d858245d9d53c9b3cd0ea314844f5cfb22fc9863..48da0167810597c11202bc6ca243827874f9f620 100644 (file)
@@ -9,17 +9,17 @@
   <body>
     <div id="body">
       <div id="header">
-       <table>
-         <tr>
-           <td class="logo"><a href="/"><img src="/static/tornado.png" alt="Tornado"/></a></td>
-           <td class="title">{% block headertitle %}{% end %}</td>
-         </tr>
-       </table>
+        <table>
+          <tr>
+            <td class="logo"><a href="/"><img src="/static/tornado.png" alt="Tornado"/></a></td>
+            <td class="title">{% block headertitle %}{% end %}</td>
+          </tr>
+        </table>
       </div>
       <div id="content">{% block body %}{% end %}</div>
       <div id="footer">
-       <div>Tornado is one of <a href="http://developers.facebook.com/opensource.php">Facebook's open source technologies</a>. It is available under the <a href="http://www.apache.org/licenses/LICENSE-2.0.html">Apache Licence, Version 2.0</a>.</div>
-       <div>This web site and all documentation is licensed under <a href="http://creativecommons.org/licenses/by/3.0/">Creative Commons 3.0</a>.</div>
+        <div>Tornado is one of <a href="http://developers.facebook.com/opensource.php">Facebook's open source technologies</a>. It is available under the <a href="http://www.apache.org/licenses/LICENSE-2.0.html">Apache Licence, Version 2.0</a>.</div>
+        <div>This web site and all documentation is licensed under <a href="http://creativecommons.org/licenses/by/3.0/">Creative Commons 3.0</a>.</div>
       </div>
     </div>
     {% block bottom %}{% end %}
index cef1660bbd9909190c37f2874d542a42a16fffb0..4aa716598bedfb9551438f795dacf46c3f7f1efe 100644 (file)
@@ -43,7 +43,7 @@ if __name__ == "__main__":
 
   <h2>Discussion and support</h2>
   <p>You can discuss Tornado and report bugs on <a href="http://groups.google.com/group/python-tornado">the Tornado developer mailing list</a>.
-       
+        
   <h2>Updates</h2>
   <p>Follow us on <a href="http://www.facebook.com/pages/Tornado-Web-Server/144144048921">Facebook</a>, <a href="http://twitter.com/tornadoweb">Twitter</a>, or <a href="http://friendfeed.com/tornado-web">FriendFeed</a> to get updates and announcements:</p>
   <div style="margin-top:1em"><a href="http://www.facebook.com/pages/Tornado-Web-Server/144144048921" style="margin-right:10px"><img src="/static/facebook.png" style="width:64px;height:64px" alt="Facebook"/></a><a href="http://twitter.com/tornadoweb" style="margin-right:10px"><img src="/static/twitter.png" style="width:64px;height:64px" alt="Twitter"/></a><a href="http://friendfeed.com/tornado-web" style="margin-right:10px"><img src="/static/friendfeed.png" style="width:64px;height:64px" alt="Facebook"/></a></div>