Skip to content

Commit ddbbc7a

Browse files
committed
Version 1.2.0
Signed-off-by: Chris Warrick <[email protected]>
1 parent bb280a4 commit ddbbc7a

File tree

9 files changed

+45
-44
lines changed

9 files changed

+45
-44
lines changed

coil/__init__.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# -*- coding: utf-8 -*-
22

3-
# Coil CMS v1.1.0
3+
# Coil CMS v1.2.0
44
# Copyright © 2014-2015 Chris Warrick, Roberto Alsina, Henry Hirsch et al.
55

66
# Permission is hereby granted, free of charge, to any
@@ -29,4 +29,4 @@
2929

3030
__all__ = ['__version__']
3131

32-
__version__ = '1.1.0'
32+
__version__ = '1.2.0'

coil/__main__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# -*- coding: utf-8 -*-
22

3-
# Coil CMS v1.1.0
3+
# Coil CMS v1.2.0
44
# Copyright © 2014-2015 Chris Warrick, Roberto Alsina, Henry Hirsch et al.
55

66
# Permission is hereby granted, free of charge, to any

coil/data/templates/convert.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import os
44
import sys
55
sys.path.append('/home/kwpolska/git/nikola/scripts')
6-
import jinjify
6+
import jinjify # NOQA
77

88
files = os.listdir('mako/')
99
for i in files:

coil/forms.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# -*- coding: utf-8 -*-
22

3-
# Coil CMS v1.1.0
3+
# Coil CMS v1.2.0
44
# Copyright © 2014-2015 Chris Warrick, Roberto Alsina, Henry Hirsch et al.
55

66
# Permission is hereby granted, free of charge, to any
@@ -79,7 +79,6 @@ class UserEditForm(Form):
7979
pass
8080

8181

82-
8382
class PermissionsForm(Form):
8483
"""A permissions form, used for CSRF protection only."""
8584
pass

coil/init.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# -*- coding: utf-8 -*-
22

3-
# Coil CMS v1.1.0
3+
# Coil CMS v1.2.0
44
# Copyright © 2014-2015 Chris Warrick, Roberto Alsina, Henry Hirsch et al.
55

66
# Permission is hereby granted, free of charge, to any

coil/tasks.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# -*- coding: utf-8 -*-
22

3-
# Coil CMS v1.1.0
3+
# Coil CMS v1.2.0
44
# Copyright © 2014-2015 Chris Warrick, Roberto Alsina, Henry Hirsch et al.
55

66
# Permission is hereby granted, free of charge, to any
@@ -96,6 +96,7 @@ def orphans(dburl, sitedir):
9696
os.chdir(oldcwd)
9797
return returncode
9898

99+
99100
def build_single(mode):
100101
"""Build, in the single-user mode."""
101102
if mode == 'force':
@@ -113,6 +114,7 @@ def build_single(mode):
113114
out = ''.join(p.stderr.readlines())
114115
return (p.returncode == 0), out
115116

117+
116118
def orphans_single(default_exec=False):
117119
"""Remove all orphans in the site, in the single user-mode."""
118120
if not default_exec and executable.endswith('uwsgi'):

coil/utils.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# -*- coding: utf-8 -*-
22

3-
# Coil CMS v1.1.0
3+
# Coil CMS v1.2.0
44
# Copyright © 2014-2015 Chris Warrick, Roberto Alsina, Henry Hirsch et al.
55

66
# Permission is hereby granted, free of charge, to any
@@ -147,8 +147,8 @@ def _write_indexlist(self, name):
147147

148148
def scan_posts(self, really=True, ignore_quit=False, quiet=True):
149149
"""Rescan the site."""
150-
while (self.db.exists('site:lock')
151-
and int(self.db.get('site:lock')) != 0):
150+
while (self.db.exists('site:lock') and
151+
int(self.db.get('site:lock')) != 0):
152152
self.logger.info("Waiting for DB lock...")
153153
time.sleep(0.5)
154154
self.db.incr('site:lock')

coil/web.py

+31-31
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# -*- coding: utf-8 -*-
22

3-
# Coil CMS v1.1.0
3+
# Coil CMS v1.2.0
44
# Copyright © 2014-2015 Chris Warrick, Roberto Alsina, Henry Hirsch et al.
55

66
# Permission is hereby granted, free of charge, to any
@@ -46,8 +46,8 @@
4646
from passlib.hash import bcrypt_sha256
4747
from coil.utils import USER_FIELDS, PERMISSIONS, PERMISSIONS_E, SiteProxy
4848
from coil.forms import (LoginForm, NewPostForm, NewPageForm, DeleteForm,
49-
UserDeleteForm, UserEditForm, AccountForm,
50-
PermissionsForm, UserImportForm, PwdHashForm)
49+
UserDeleteForm, UserEditForm, AccountForm,
50+
PermissionsForm, UserImportForm, PwdHashForm)
5151

5252
_site = None
5353
site = None
@@ -160,8 +160,8 @@ def configure_site():
160160
_site.config['TRANSLATIONS'])
161161

162162
# Theme must inherit from bootstrap3, because we have hardcoded HTML.
163-
bs3 = (('bootstrap3' in _site.THEMES)
164-
or ('bootstrap3-jinja' in _site.THEMES))
163+
bs3 = (('bootstrap3' in _site.THEMES) or
164+
('bootstrap3-jinja' in _site.THEMES))
165165
if not bs3:
166166
app.logger.notice("THEME does not inherit from 'bootstrap3' or "
167167
"'bootstrap3-jinja', using 'bootstrap3' instead.")
@@ -252,7 +252,7 @@ def generate_menu():
252252
if needs_rebuild not in ('0', '-1'):
253253
return ('</li><li><a href="{0}"><i class="fa fa-fw '
254254
'fa-warning"></i> <strong>Rebuild</strong></a></li>'.format(
255-
url_for('rebuild')))
255+
url_for('rebuild')))
256256
else:
257257
return ('</li><li><a href="{0}"><i class="fa fa-fw '
258258
'fa-cog"></i> Rebuild</a></li>'.format(url_for('rebuild')))
@@ -602,8 +602,8 @@ def index():
602602
posts = []
603603
pages = []
604604
for p in site.timeline:
605-
if (p.meta('author.uid')
606-
and p.meta('author.uid') != str(current_user.uid)):
605+
if (p.meta('author.uid') and
606+
p.meta('author.uid') != str(current_user.uid)):
607607
continue
608608
if p.is_post:
609609
posts.append(p)
@@ -637,8 +637,8 @@ def edit(path):
637637

638638
current_auid = int(post.meta('author.uid') or current_user.uid)
639639

640-
if (not current_user.can_edit_all_posts
641-
and current_auid != current_user.uid):
640+
if (not current_user.can_edit_all_posts and
641+
current_auid != current_user.uid):
642642
return error("Cannot edit posts of other users.", 401)
643643

644644
if request.method == 'POST':
@@ -652,8 +652,8 @@ def edit(path):
652652
author_change_success = True
653653
except:
654654
author_change_success = False
655-
if (not current_user.can_transfer_post_authorship
656-
or not author_change_success):
655+
if (not current_user.can_transfer_post_authorship or
656+
not author_change_success):
657657
meta['author'] = post.meta('author') or current_user.realname
658658
meta['author.uid'] = str(current_auid)
659659

@@ -690,7 +690,8 @@ def edit(path):
690690
if db is not None:
691691
uids = db.hgetall('users').values()
692692
for u in uids:
693-
realname, active = db.hmget('user:{0}'.format(u), 'realname', 'active')
693+
realname, active = db.hmget('user:{0}'.format(u),
694+
'realname', 'active')
694695
if active == '1':
695696
users.append((u, realname))
696697
else:
@@ -721,8 +722,8 @@ def delete():
721722

722723
current_auid = int(post.meta('author.uid') or current_user.uid)
723724

724-
if (not current_user.can_edit_all_posts
725-
and current_auid != current_user.uid):
725+
if (not current_user.can_edit_all_posts and
726+
current_auid != current_user.uid):
726727
return error("Cannot edit posts of other users.", 401)
727728

728729
os.unlink(path)
@@ -760,8 +761,8 @@ def api_rebuild():
760761
d = json.dumps({'build': build_job.meta, 'orphans': orphans_job.meta})
761762

762763
if ('status' in build_job.meta and
763-
build_job.meta['status'] is not None
764-
and 'status' in orphans_job.meta and
764+
build_job.meta['status'] is not None and
765+
'status' in orphans_job.meta and
765766
orphans_job.meta['status'] is not None):
766767
rq.cancel_job('build', db)
767768
rq.cancel_job('orphans', db)
@@ -787,22 +788,21 @@ def rebuild(mode=''):
787788
db.set('site:needs_rebuild', '-1')
788789
if not q.fetch_job('build') and not q.fetch_job('orphans'):
789790
b = q.enqueue_call(func=coil.tasks.build,
790-
args=(app.config['REDIS_URL'],
791-
app.config['NIKOLA_ROOT'], mode), job_id='build')
791+
args=(app.config['REDIS_URL'],
792+
app.config['NIKOLA_ROOT'], mode),
793+
job_id='build')
792794
q.enqueue_call(func=coil.tasks.orphans,
793-
args=(app.config['REDIS_URL'],
794-
app.config['NIKOLA_ROOT']), job_id='orphans',
795-
depends_on=b)
795+
args=(app.config['REDIS_URL'],
796+
app.config['NIKOLA_ROOT']), job_id='orphans',
797+
depends_on=b)
796798
return render('coil_rebuild.tmpl', {'title': 'Rebuild'})
797799
else:
798800
status, outputb = coil.tasks.build_single(mode)
799801
_, outputo = coil.tasks.orphans_single()
800802
site.coil_needs_rebuild = '0'
801-
return render('coil_rebuild_single.tmpl', {'title': 'Rebuild',
802-
'status': '1' if status else '0',
803-
'outputb': outputb,
804-
'outputo': outputo})
805-
803+
return render('coil_rebuild_single.tmpl',
804+
{'title': 'Rebuild', 'status': '1' if status else '0',
805+
'outputb': outputb, 'outputo': outputo})
806806

807807

808808
@app.route('/new/<obj>/', methods=['POST'])
@@ -965,10 +965,10 @@ def acp_pwdhash():
965965
else:
966966
pwdhash = None
967967
status = False
968-
return render('coil_pwdhash.tmpl', context={'title': 'My account',
969-
'pwdhash': pwdhash,
970-
'status': status,
971-
'form': form})
968+
return render('coil_pwdhash.tmpl',
969+
context={'title': 'My account', 'pwdhash': pwdhash,
970+
'status': status, 'form': form})
971+
972972

973973
@app.route('/users/')
974974
@login_required

docs/conf.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,9 @@
5555
# built documents.
5656
#
5757
# The short X.Y version.
58-
version = '1.1.0'
58+
version = '1.2.0'
5959
# The full version, including alpha/beta/rc tags.
60-
release = '1.1.0'
60+
release = '1.2.0'
6161

6262
# The language for content autogenerated by Sphinx. Refer to documentation
6363
# for a list of supported languages.

0 commit comments

Comments
 (0)