remove unused code, fix pyflakes and jshint hints

This commit is contained in:
Martin Zimmermann 2014-05-28 11:05:10 +02:00
parent 8c6a7e209e
commit 64054ec029
10 changed files with 11 additions and 17 deletions

View File

@ -16,7 +16,6 @@ import pkg_resources
dist = pkg_resources.get_distribution("isso")
import sys
import os
from os.path import join, dirname
sys.path.insert(0, join(dirname(__file__), "_isso/"))

View File

@ -17,7 +17,8 @@ define(function() {
var js = document.getElementsByTagName("script");
for (var i = 0; i < js.length; i++) {
[].forEach.call(js[i].attributes, function(attr) {
for (var j = 0; j < js[i].attributes.length; j++) {
var attr = js[i].attributes[j];
if (/^data-isso-/.test(attr.name)) {
try {
config[attr.name.substring(10)] = JSON.parse(attr.value);
@ -25,7 +26,7 @@ define(function() {
config[attr.name.substring(10)] = attr.value;
}
}
});
}
}
// split avatar-fg on whitespace

View File

@ -4,7 +4,7 @@ define(["app/api", "app/dom", "app/i18n"], function(api, $, i18n) {
var objs = {};
$.each("a", function(el) {
if (! el.href.match("#isso-thread$")) {
if (! el.href.match(/#isso-thread$/)) {
return;
}

View File

@ -18,11 +18,11 @@ define(function() {
}
};
var defer = function() {
var Defer = function() {
this.promise = new Promise();
};
defer.prototype = {
Defer.prototype = {
promise: Promise,
resolve: function(rv) {
this.promise.success.forEach(function(callback) {
@ -50,7 +50,7 @@ define(function() {
};
return {
defer: function() { return new defer(); },
defer: function() { return new Defer(); },
when: when
};

View File

@ -1,5 +1,5 @@
require(["app/lib/ready", "app/count"], function(domready, count) {
domready(function() {
count();
})
});
});

View File

@ -10,7 +10,7 @@ define(function() {
if (typeof process !== "undefined") {
var fs = require.nodeRequire("fs");
var jade = require.nodeRequire("jade");
jade = require.nodeRequire("jade");
fetchText = function(path, callback) {
callback(fs.readFileSync(path, "utf-8"));
};

View File

@ -353,7 +353,7 @@ class TestComments(unittest.TestCase):
def testDeleteCommentRemovesThread(self):
rv = self.client.post('/new?uri=%2F', data=json.dumps({"text": "..."}))
self.client.post('/new?uri=%2F', data=json.dumps({"text": "..."}))
self.assertIn('/', self.app.db.threads)
self.client.delete('/id/1')
self.assertNotIn('/', self.app.db.threads)

View File

@ -89,7 +89,7 @@ class TestDBMigration(unittest.TestCase):
"VALUEs (?, ?, ?)", (id, parent, id))
conf = Config.load(None)
db = SQLite3(self.path, conf)
SQLite3(self.path, conf)
flattened = [
(1, None),

View File

@ -8,11 +8,6 @@ werkzeug = pkg_resources.get_distribution("werkzeug")
import json
import hashlib
try:
from html.parser import HTMLParser, HTMLParseError
except ImportError:
from HTMLParser import HTMLParser, HTMLParseError
from werkzeug.wrappers import Request, Response
from werkzeug.exceptions import BadRequest

View File

@ -10,7 +10,6 @@ html5lib_version = pkg_resources.get_distribution("html5lib").version
from html5lib.sanitizer import HTMLSanitizer
from html5lib.serializer import HTMLSerializer
from html5lib.treewalkers import getTreeWalker
import misaka