tornado.options.define("port", type=int, default=8001, help="Port to listen on")
-from webapp import Application
+from ipfire.web import Application
def run():
tornado.options.parse_command_line()
import tornado.options
import tornado.web
-import backend
+import ipfire
from handlers import *
from ui_modules import *
class Application(tornado.web.Application):
def __init__(self, config, **kwargs):
# Initialize backend
- self.backend = backend.Backend(config)
+ self.backend = ipfire.Backend(config)
settings = dict(
debug = tornado.options.options.debug,
import tornado.web
#import unicodedata
-import backend
-
from handlers_accounts import *
from handlers_admin import *
from handlers_base import *
from handlers_base import *
-import backend
-
class AdminBaseHandler(BaseHandler):
pass
import tornado.locale
import tornado.web
-import backend.util
+from .. import util
class BaseHandler(tornado.web.RequestHandler):
rss_url = None
today = datetime.date.today()
ret = {
- "format_size" : backend.util.format_size,
- "format_time" : backend.util.format_time,
+ "format_size" : util.format_size,
+ "format_time" : util.format_time,
"hostname" : self.hostname,
"rss_url" : self.rss_url,
"year" : today.year,
import tornado.options
import tornado.web
-import backend
-
from handlers_base import BaseHandler
BASEDIR = os.path.dirname(__file__)
import random
import tornado.web
-import backend
-
from handlers_base import *
class DownloadsIndexHandler(BaseHandler):
import hwdata
import logging
import re
-import simplejson
+import json
import tornado.web
-import backend
+from .. import fireinfo
from handlers_base import *
# Try to decode the profile.
try:
- return simplejson.loads(profile)
- except simplejson.decoder.JSONDecodeError, e:
+ return json.loads(profile)
+ except json.decoder.JSONDecodeError, e:
raise tornado.web.HTTPError(400, "Profile could not be decoded: %s" % e)
# The GET method is only allowed in debugging mode.
try:
self.fireinfo.handle_profile(public_id, profile_blob, location=location)
- except backend.fireinfo.ProfileParserError:
+ except fireinfo.ProfileParserError:
raise tornado.web.HTTPError(400)
self.finish("Your profile was successfully saved to the database.")
import tornado.web
from handlers_base import *
-import backend
class IUseImage(BaseHandler):
expires = 3600 * 3
import logging
import textile
-import backend
+from .. import database
from handlers_base import *
# Render text
n.text = textile.textile(n.text.decode("utf-8"))
- item = backend.database.Row({
+ item = database.Row({
"title" : n.title,
"author" : n.author,
"published" : n.published,
import tornado.web
import unicodedata
-import backend
+from .. import database
class UIModule(tornado.web.UIModule):
@property
other_countries.append(name)
continue
- country = backend.database.Row({
+ country = database.Row({
"code" : code,
"name" : name,
"value" : value,