Skip to content
Permalink
Browse files

make sure a Nikola site exists

Signed-off-by: Chris Warrick <kwpolska@gmail.com>
  • Loading branch information...
Kwpolska committed Jan 12, 2015
1 parent 50fd759 commit 61020cf42af5f315c8d4e10dd9c07bc268c368d7
Showing with 20 additions and 12 deletions.
  1. +15 −11 comet/__main__.py
  2. +5 −1 comet/web.py
@@ -76,17 +76,21 @@ def write_users(arguments):

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

if arguments['--browser']:
webbrowser.open(url)

comet.web.app.logger.info(u"Comet CMS running @ {0}".format(url))
comet.web.app.run('localhost', port, debug=True)
return 0
if comet.web.app:
port = int(arguments['--port'])
url = 'http://localhost:{0}/'.format(port)
comet.web.configure_url(url)
comet.web.app.config['DEBUG'] = True

if arguments['--browser']:
webbrowser.open(url)

comet.web.app.logger.info(u"Comet CMS running @ {0}".format(url))
comet.web.app.run('localhost', port, debug=True)
return 0
else:
print("FATAL: no conf.py found")
return 255

if __name__ == '__main__':
main()
@@ -844,4 +844,8 @@ def display_permission(user, permission):
'json': json,
'display_permission': display_permission})

configure_site()
if not os.path.exists('._COMET_NO_CONFIG') and os.path.exists('conf.py'):
configure_site()
else:
# no Nikola site available
app = None

0 comments on commit 61020cf

Please sign in to comment.
You can’t perform that action at this time.