Commit 0ec068f2 authored by gijs's avatar gijs
Browse files

Less logging in production

parent d4753553
......@@ -72,14 +72,16 @@ class Command(BaseCommand):
os.mkdir(os.path.join(outputdir, 'pages'))
os.mkdir(os.path.join(outputdir, 'tags'))
info('Copying static files')
print('Copying static files')
shutil.copytree(staticdir, os.path.join(outputdir, 'static'))
print('Parsing pads')
parse_pads()
info('Read pads')
info('Generating output')
print('Read pads')
print('Generating output')
produsers = collectionFor('produser')
events = collectionFor('event')
......@@ -138,4 +140,7 @@ class Command(BaseCommand):
output(os.path.join(outputdir, 'index.html'), 'index.html', { 'events': sorted(events.models, key=datesorter, reverse=True) })
if not DEBUG:
print('Collecting static')
call_command('collectstatic', interactive=False)
print('Done')
......@@ -482,7 +482,6 @@ contentTypes = {
}
def collectionFor (contentType):
print(contentType)
if contentType in contentTypes:
return contentTypes[contentType]['collection']
else:
......
......@@ -71,8 +71,8 @@ def parse_pads ():
error('Model for key {} already filled'.format(key))
except UnknownContentTypeError as e:
print('Skipped `{}`'.format(name))
print(e)
debug('Skipped `{}`'.format(name))
debug(e)
pass
info('Read {}'.format(pad.display_slug))
......@@ -87,7 +87,7 @@ class Command(BaseCommand):
for produser in collectionFor('produser').models:
for k in dir(produser):
print(getattr(produser, k))
info(getattr(produser, k))
# print(collectionFor('produser').models)
# print(collectionFor('event').models, collectionFor('event').models[0].metadata, collectionFor('event').models[0].metadata['produser'].metadata)
\ No newline at end of file
from ethertoff.settings import DEBUG
MENU_ITEMS = [
('About', 'pages/about.html'),
('Produsers', 'produsers.html' ),
......@@ -8,6 +10,9 @@ MENU_ITEMS = [
SITE_URL = ''
SHOW_LOG_MESSAGES = DEBUG
SHOW_DEBUG_MESSAGES = DEBUG
try:
LOCAL_SETTINGS
except NameError:
......
DEBUG = True
from .settings import SHOW_LOG_MESSAGES
from .settings import SHOW_DEBUG_MESSAGES
CRED = '\033[91m'
CGREEN = '\033[92m'
......@@ -8,10 +9,11 @@ CCYAN = '\033[96m'
CEND = '\033[0m'
def info(*args):
print(*args)
if SHOW_LOG_MESSAGES:
print(*args)
def debug(*args, color=CYELLOW):
if DEBUG:
if SHOW_DEBUG_MESSAGES:
print(color, *args, CEND)
def error(*args):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment