Compare commits
7 Commits
master
...
legacy/0.2
Author | SHA1 | Date | |
---|---|---|---|
![]() |
95e8bcf256 | ||
![]() |
d9ff690057 | ||
![]() |
c5af859286 | ||
![]() |
6924d480d5 | ||
![]() |
9721b781b9 | ||
![]() |
2fbc3623e8 | ||
![]() |
26544b69be |
2
.gitignore
vendored
2
.gitignore
vendored
@ -14,4 +14,6 @@
|
|||||||
/isso.egg-info/
|
/isso.egg-info/
|
||||||
/isso/js/components
|
/isso/js/components
|
||||||
/isso/js/embed.min.js
|
/isso/js/embed.min.js
|
||||||
|
/isso/js/embed.dev.js
|
||||||
/isso/js/count.min.js
|
/isso/js/count.min.js
|
||||||
|
/isso/js/count.dev.js
|
||||||
|
14
CHANGES.rst
14
CHANGES.rst
@ -1,7 +1,19 @@
|
|||||||
Changelog for Isso
|
Changelog for Isso
|
||||||
==================
|
==================
|
||||||
|
|
||||||
0.2.1 (2013-10-30)
|
0.2.4 (unreleased)
|
||||||
|
------------------
|
||||||
|
|
||||||
|
- Nothing changed yet.
|
||||||
|
|
||||||
|
|
||||||
|
0.2.3 (2013-10-31)
|
||||||
|
------------------
|
||||||
|
|
||||||
|
- Nothing changed yet.
|
||||||
|
|
||||||
|
|
||||||
|
0.2.2 (2013-10-31)
|
||||||
------------------
|
------------------
|
||||||
|
|
||||||
- Nothing changed yet.
|
- Nothing changed yet.
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
include isso/js/embed.min.js
|
include isso/js/embed.min.js
|
||||||
|
include isso/js/embed.dev.js
|
||||||
include isso/js/count.min.js
|
include isso/js/count.min.js
|
||||||
|
include isso/js/count.dev.js
|
||||||
|
|
||||||
include isso/css/isso.css
|
include isso/css/isso.css
|
||||||
include isso/static/post.html
|
include isso/static/post.html
|
||||||
|
10
Makefile
Normal file
10
Makefile
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
all: css js
|
||||||
|
|
||||||
|
css:
|
||||||
|
scss --no-cache isso/css/isso.scss isso/css/isso.css
|
||||||
|
|
||||||
|
js:
|
||||||
|
r.js -o isso/js/build.embed.js
|
||||||
|
r.js -o isso/js/build.embed.js optimize="none" out="isso/js/embed.dev.js"
|
||||||
|
r.js -o isso/js/build.count.js
|
||||||
|
r.js -o isso/js/build.count.js optimize="none" out="isso/js/count.dev.js"
|
@ -58,7 +58,7 @@ from jinja2 import Environment, FileSystemLoader
|
|||||||
|
|
||||||
from isso import db, migrate, views, wsgi
|
from isso import db, migrate, views, wsgi
|
||||||
from isso.core import ThreadedMixin, uWSGIMixin, Config
|
from isso.core import ThreadedMixin, uWSGIMixin, Config
|
||||||
from isso.utils import parse
|
from isso.utils import parse, http
|
||||||
from isso.views import comment, admin
|
from isso.views import comment, admin
|
||||||
|
|
||||||
logging.getLogger('werkzeug').setLevel(logging.ERROR)
|
logging.getLogger('werkzeug').setLevel(logging.ERROR)
|
||||||
@ -164,14 +164,9 @@ def make_app(conf=None):
|
|||||||
|
|
||||||
isso = App(conf)
|
isso = App(conf)
|
||||||
|
|
||||||
for line in conf.getiter("general", "host"):
|
for host in conf.getiter("general", "host"):
|
||||||
try:
|
with http.curl('HEAD', host, '/', 5) as resp:
|
||||||
host, port, ssl = parse.host(line)
|
if resp is not None:
|
||||||
con = httplib.HTTPSConnection if ssl else httplib.HTTPConnection
|
|
||||||
con(host, port, timeout=5).request('GET', '/')
|
|
||||||
except (httplib.HTTPException, socket.error):
|
|
||||||
continue
|
|
||||||
else:
|
|
||||||
logger.info("connected to HTTP server")
|
logger.info("connected to HTTP server")
|
||||||
break
|
break
|
||||||
else:
|
else:
|
||||||
|
@ -28,7 +28,7 @@ define(["q"], function(Q) {
|
|||||||
if (js[i].src.match("/js/components/requirejs/require\\.js$")) {
|
if (js[i].src.match("/js/components/requirejs/require\\.js$")) {
|
||||||
endpoint = js[i].src.substring(0, js[i].src.length - 35);
|
endpoint = js[i].src.substring(0, js[i].src.length - 35);
|
||||||
break;
|
break;
|
||||||
} else if (js[i].src.match("/js/(embed|count)\\.min\\.js$")) {
|
} else if (js[i].src.match("/js/(embed|count)\\.(min|dev)\\.js$")) {
|
||||||
endpoint = js[i].src.substring(0, js[i].src.length - 16);
|
endpoint = js[i].src.substring(0, js[i].src.length - 16);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -12,14 +12,27 @@ except ImportError:
|
|||||||
from isso.utils import parse
|
from isso.utils import parse
|
||||||
|
|
||||||
|
|
||||||
def curl(method, host, path, timeout=3):
|
class curl(object):
|
||||||
|
|
||||||
host, port, ssl = parse.host(host)
|
def __init__(self, method, host, path, timeout=3):
|
||||||
|
self.method = method
|
||||||
|
self.host = host
|
||||||
|
self.path = path
|
||||||
|
self.timeout = timeout
|
||||||
|
|
||||||
|
def __enter__(self):
|
||||||
|
|
||||||
|
host, port, ssl = parse.host(self.host)
|
||||||
http = httplib.HTTPSConnection if ssl else httplib.HTTPConnection
|
http = httplib.HTTPSConnection if ssl else httplib.HTTPConnection
|
||||||
|
|
||||||
with closing(http(host, port, timeout=timeout)) as con:
|
self.con = http(host, port, timeout=self.timeout)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
con.request(method, path)
|
self.con.request(self.method, self.path)
|
||||||
except (httplib.HTTPException, socket.error):
|
except (httplib.HTTPException, socket.error):
|
||||||
return None
|
return None
|
||||||
return con.getresponse()
|
|
||||||
|
return self.con.getresponse()
|
||||||
|
|
||||||
|
def __exit__(self, exc_type, exc_value, traceback):
|
||||||
|
self.con.close()
|
||||||
|
@ -73,7 +73,7 @@ def new(app, environ, request, uri):
|
|||||||
with app.lock:
|
with app.lock:
|
||||||
if uri not in app.db.threads:
|
if uri not in app.db.threads:
|
||||||
for host in app.conf.getiter('general', 'host'):
|
for host in app.conf.getiter('general', 'host'):
|
||||||
resp = http.curl('HEAD', host, uri)
|
with http.curl('GET', host, uri) as resp:
|
||||||
if resp and resp.status == 200:
|
if resp and resp.status == 200:
|
||||||
title = parse.title(resp.read())
|
title = parse.title(resp.read())
|
||||||
break
|
break
|
||||||
|
2
setup.py
2
setup.py
@ -15,7 +15,7 @@ if sys.version_info < (3, 0):
|
|||||||
|
|
||||||
setup(
|
setup(
|
||||||
name='isso',
|
name='isso',
|
||||||
version='0.2.1',
|
version='0.2.4.dev0',
|
||||||
author='Martin Zimmermann',
|
author='Martin Zimmermann',
|
||||||
author_email='info@posativ.org',
|
author_email='info@posativ.org',
|
||||||
packages=find_packages(),
|
packages=find_packages(),
|
||||||
|
Loading…
Reference in New Issue
Block a user