Skip to content

Commit

Permalink
add @hhirsch back to ©
Browse files Browse the repository at this point in the history
Signed-off-by: Chris Warrick <kwpolska@gmail.com>
  • Loading branch information
Kwpolska committed Jan 10, 2015
1 parent f96b7b0 commit 270b376
Show file tree
Hide file tree
Showing 10 changed files with 34 additions and 23 deletions.
2 changes: 1 addition & 1 deletion LICENSE
@@ -1,4 +1,4 @@
Copyright © 2014-2015 Chris Warrick, Roberto Alsina et al.
Copyright © 2014-2015 Chris Warrick, Roberto Alsina, Henry Hirsch et al.

Permission is hereby granted, free of charge, to any
person obtaining a copy of this software and associated
Expand Down
2 changes: 1 addition & 1 deletion comet/__init__.py
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-

# Comet CMS v0.6.0
# Copyright © 2014-2015 Chris Warrick, Roberto Alsina et al.
# Copyright © 2014-2015 Chris Warrick, Roberto Alsina, Henry Hirsch et al.

# Permission is hereby granted, free of charge, to any
# person obtaining a copy of this software and associated
Expand Down
16 changes: 10 additions & 6 deletions comet/__main__.py
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-

# Comet CMS v0.6.0
# Copyright © 2014-2015 Chris Warrick, Roberto Alsina et al.
# Copyright © 2014-2015 Chris Warrick, Roberto Alsina, Henry Hirsch et al.

# Permission is hereby granted, free of charge, to any
# person obtaining a copy of this software and associated
Expand Down Expand Up @@ -48,9 +48,11 @@

__doc__ = __doc__.format(comet.__version__)


def main():
u"""The main function."""
arguments = docopt.docopt(__doc__, version=u'Comet CMS v{0}'.format(comet.__version__))
arguments = docopt.docopt(__doc__, version=u'Comet CMS v{0}'.format(
comet.__version__))
if arguments[u'init']:
sys.exit(init(arguments))
elif arguments[u'devserver']:
Expand All @@ -61,16 +63,18 @@ def init(arguments):
import comet.init
return comet.init.init()


def devserver(arguments):
import comet.web
port = int(arguments[u'port'])
port = int(arguments['--port'])
url = 'http://localhost:{0}/'.format(port)
comet.web.configure_site(url)
comet.web.configure_url(url)
comet.web.app.config['DEBUG'] = True

if arguments[u'browser']:
if arguments['--browser']:
webbrowser.open(url)
comet.web.app.logger.info(u"Comet CMS running @ http://localhost:8001/")

comet.web.app.logger.info(u"Comet CMS running @ {0}".format(url))
comet.web.app.run('localhost', port, debug=True)
return 0

Expand Down
2 changes: 1 addition & 1 deletion comet/data/comet_assets/css/comet.css
@@ -1,5 +1,5 @@
/*
* Copyright © 2014-2015, Chris Warrick et al.
* Copyright © 2014-2015 Chris Warrick, Roberto Alsina, Henry Hirsch et al.
* See /LICENSE for licensing information.
*/

Expand Down
2 changes: 1 addition & 1 deletion comet/data/comet_assets/js/comet.js
@@ -1,5 +1,5 @@
/*
* Copyright © 2014-2015, Chris Warrick et al.
* Copyright © 2014-2015 Chris Warrick, Roberto Alsina, Henry Hirsch et al.
* See /LICENSE for licensing information.
*/

Expand Down
3 changes: 2 additions & 1 deletion comet/init.py
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-

# Comet CMS v0.6.0
# Copyright © 2014-2015 Chris Warrick, Roberto Alsina et al.
# Copyright © 2014-2015 Chris Warrick, Roberto Alsina, Henry Hirsch et al.

# Permission is hereby granted, free of charge, to any
# person obtaining a copy of this software and associated
Expand All @@ -27,6 +27,7 @@

from __future__ import print_function, unicode_literals


def init():
print("ERROR: Not implemented.")
return 255
24 changes: 16 additions & 8 deletions comet/web.py
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-

# Comet CMS v0.6.0
# Copyright © 2014-2015 Chris Warrick, Roberto Alsina et al.
# Copyright © 2014-2015 Chris Warrick, Roberto Alsina, Henry Hirsch et al.

# Permission is hereby granted, free of charge, to any
# person obtaining a copy of this software and associated
Expand Down Expand Up @@ -51,7 +51,13 @@ def scan_site():
nikola.utils.LOGGER.info("Posts scanned.")


def configure_site(url=None):
def configure_url(url):
"""Configure site URL."""
app.config['COMET_URL'] = site.config['SITE_URL'] =\
site.config['BASE_URL'] = site.GLOBAL_CONTEXT['blog_url'] = url


def configure_site():
"""Configure the site for Comet."""
global site

Expand Down Expand Up @@ -99,19 +105,19 @@ def configure_site(url=None):
else:
raise Exception("Not a Nikola site.")

app.secret_key = site.config['COMET_SECRET_KEY']
app.config['COMET_URL'] = url or site.config['COMET_URL']
app.secret_key = site.config.get('COMET_SECRET_KEY')
app.config['COMET_URL'] = site.config.get('COMET_URL')

read_users()

site.template_hooks['menu_alt'].append(generate_menu_alt)

app.config['NIKOLA_URL'] = site.config['SITE_URL']
site.config['SITE_URL'] = site.config['BASE_URL'] =\
site.GLOBAL_CONTEXT['blog_url'] = app.config['COMET_URL']
configure_url(app.config['COMET_URL'])
site.config['NAVIGATION_LINKS'] = {
'en': (
(app.config['NIKOLA_URL'], '<i class="fa fa-globe"></i> Back to website'),
(app.config['NIKOLA_URL'],
'<i class="fa fa-globe"></i> Back to website'),
('/rebuild', '<i class="fa fa-cog rebuild"></i> Rebuild'),
)
}
Expand Down Expand Up @@ -566,7 +572,6 @@ def delete():
return redirect('/')



@app.route('/rebuild')
@login_required
def rebuild():
Expand All @@ -581,6 +586,7 @@ def rescan():
scan_site()
return redirect('/')


@app.route('/wysihtml/<path:path>')
def serve_wysihtml(path):
"""Serve wysihtml files.
Expand Down Expand Up @@ -823,3 +829,5 @@ def display_permission(user, permission):
'action': action,
'json': json,
'display_permission': display_permission})

configure_site()
2 changes: 1 addition & 1 deletion docs/LICENSE.rst
Expand Up @@ -2,7 +2,7 @@
Appendix C. License
===================

Copyright © 2014-2015 Chris Warrick, Roberto Alsina et al.
Copyright © 2014-2015 Chris Warrick, Roberto Alsina, Henry Hirsch et al.

Permission is hereby granted, free of charge, to any
person obtaining a copy of this software and associated
Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Expand Up @@ -48,7 +48,7 @@

# General information about the project.
project = 'Comet CMS'
copyright = '2014-2015, Chris Warrick and the Comet contributors'
copyright = '2014-2015 Chris Warrick, Roberto Alsina, Henry Hirsch et al.'

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
Expand Down
2 changes: 0 additions & 2 deletions docs/web.rst
Expand Up @@ -2,9 +2,7 @@
Internals
=========

This is the documentation of ``comet.web``, which is the heart of Comet CMS.

.. index:: internals
.. versionadded:: 0.6.0
.. automodule:: comet.web
:members:

0 comments on commit 270b376

Please sign in to comment.