Skip to content

Commit

Permalink
fix: some bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
Laisky committed Nov 7, 2017
1 parent c08ced7 commit e8787a8
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
10 changes: 5 additions & 5 deletions ramjet/__main__.py
Expand Up @@ -36,10 +36,10 @@ def setup_args():

def setup_options():
opt.set_option('email_sender',
EmailSender(host=settings.MAIL_HOST,
port=settings.MAIL_PORT,
username=settings.MAIL_USERNAME,
passwd=settings.MAIL_PASSWD))
EmailSender(host=settings.MAIL_HOST,
port=settings.MAIL_PORT,
username=settings.MAIL_USERNAME,
passwd=settings.MAIL_PASSWD))


def main():
Expand Down Expand Up @@ -68,7 +68,7 @@ def main():
web.run_app(app, host='localhost', port=opt.PORT)
except Exception:
logger.exception('ramjet got error:')
email_sender.send_email(
opt.email_sender.send_email(
mail_to=settings.MAIL_TO_ADDRS,
mail_from=settings.MAIL_FROM_ADDR,
subject='ramjet error',
Expand Down
3 changes: 2 additions & 1 deletion ramjet/tasks/__init__.py
@@ -1,4 +1,5 @@
import os
import pathlib
import importlib

from kipp.options import opt
Expand All @@ -15,7 +16,7 @@


def setup_webapp(app):
app.router.add_static('/static', os.path.join(settings.CWD, 'tasks', 'static'), show_index=True)
app.router.add_static('/static', pathlib.Path(settings.CWD, 'tasks', 'static').absolute(), show_index=True)


def setup_tasks(app):
Expand Down
1 change: 1 addition & 0 deletions ramjet/utils/__init__.py
Expand Up @@ -18,6 +18,7 @@
from .jinja import debug_wrapper, TemplateRendering
from .mail import send_mail
from .encrypt import generate_token, validate_token, generate_passwd, validate_passwd
from .db import get_conn


UTC = pytz.timezone('utc')
Expand Down

0 comments on commit e8787a8

Please sign in to comment.