From 1ddf4bede47f793b3142b1ff3bad800fa8c1bda9 Mon Sep 17 00:00:00 2001 From: James Vasile Date: Sat, 9 Feb 2013 12:35:08 -0500 Subject: [PATCH] Adjust how modules are imported * change to u. notation for util, since from foo import * is evil * make import vendor.foo possible * vendor dir is part of the repo now, no need to mkdir * use the vendor.foo notation --- Makefile | 1 - plinth.py | 11 +++++------ vendor/__init__.py | 0 3 files changed, 5 insertions(+), 7 deletions(-) create mode 100644 vendor/__init__.py diff --git a/Makefile b/Makefile index aa4df0f60..cf29a63a3 100644 --- a/Makefile +++ b/Makefile @@ -51,7 +51,6 @@ data/users.sqlite3: data/users.sqlite3.distrib dirs: @mkdir -p data/cherrypy_sessions - @mkdir -p vendor config: Makefile @test -f plinth.config || cp plinth.sample.config plinth.config diff --git a/plinth.py b/plinth.py index 4f883107f..1cf301964 100755 --- a/plinth.py +++ b/plinth.py @@ -12,14 +12,13 @@ from cherrypy.process.plugins import Daemonizer Daemonizer(cherrypy.engine).subscribe() import plugin_mount -from util import * +import util as u + from logger import Logger #from modules.auth import AuthController, require, member_of, name_is -import withsqlite -from withsqlite.withsqlite import sqlite_db -import exmachina -from exmachina.exmachina import ExMachinaClient +from vendor.withsqlite.withsqlite import sqlite_db +from vendor.exmachina.exmachina import ExMachinaClient import socket __version__ = "0.2.14" @@ -31,7 +30,7 @@ __email__ = "james@jamesvasile.com" __status__ = "Development" def error_page(status, dynamic_msg, stock_msg): - return page_template(template="err", title=status, main="

%s

%s" % (dynamic_msg, stock_msg)) + return u.page_template(template="err", title=status, main="

%s

%s" % (dynamic_msg, stock_msg)) def error_page_404(status, message, traceback, version): return error_page(status, message, """

If you believe this diff --git a/vendor/__init__.py b/vendor/__init__.py new file mode 100644 index 000000000..e69de29bb