]> git.ipfire.org Git - ipfire.org.git/commitdiff
Fix relative imports
authorMichael Tremer <michael.tremer@ipfire.org>
Thu, 12 Jul 2018 16:01:21 +0000 (17:01 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Thu, 12 Jul 2018 16:01:21 +0000 (17:01 +0100)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/scripts/ipfire.org-webapp.in
src/web/__init__.py
src/web/handlers.py
src/web/handlers_admin.py
src/web/handlers_base.py
src/web/handlers_boot.py
src/web/handlers_download.py
src/web/handlers_fireinfo.py
src/web/handlers_iuse.py
src/web/handlers_rss.py
src/web/ui_modules.py

index 588031dadac68cdb84d5075adf5122a28d0859e4..8b1b02a903e162c2b8d52cef9b153f43274daa92 100755 (executable)
@@ -5,7 +5,7 @@ import tornado.options
 
 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()
index 0a241d17d3498ba83236a404f37b44263484ddd1..fdd5b477b6bbc60db5b5ef7bac89aca1bca0a8b2 100644 (file)
@@ -6,7 +6,7 @@ import tornado.locale
 import tornado.options
 import tornado.web
 
-import backend
+import ipfire
 
 from handlers import *
 from ui_modules import *
@@ -16,7 +16,7 @@ BASEDIR = os.path.join(os.path.dirname(__file__), "..")
 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,
index d380d5f4ec7035992d36d1117bbcb993e9ed9488..79e3f4d96c162ad088d02d3f1ed831f92d5b5b03 100644 (file)
@@ -15,8 +15,6 @@ import tornado.gen
 import tornado.web
 #import unicodedata
 
-import backend
-
 from handlers_accounts import *
 from handlers_admin import *
 from handlers_base import *
index b7a3f9d1bd94b5e86d8a105ad4ea0477d04b5432..36ee0bad04a7ede94e45eb3a58098bc4208bda15 100644 (file)
@@ -5,8 +5,6 @@ import tornado.web
 
 from handlers_base import *
 
-import backend
-
 class AdminBaseHandler(BaseHandler):
        pass
 
index 9575a4b3d0fd29fa41fc2ea15759b72cdffa2caa..96f81774133b4fe1a919ebca5372a90fbebf14a0 100644 (file)
@@ -11,7 +11,7 @@ import time
 import tornado.locale
 import tornado.web
 
-import backend.util
+from .. import util
 
 class BaseHandler(tornado.web.RequestHandler):
        rss_url = None
@@ -37,8 +37,8 @@ class BaseHandler(tornado.web.RequestHandler):
                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,
index 0fc23c03529cc22c5ed404583fb6848838174714..3922ad46a47277cf7628bdcb409e46236a95dbe7 100644 (file)
@@ -8,8 +8,6 @@ import tornado.locale
 import tornado.options
 import tornado.web
 
-import backend
-
 from handlers_base import BaseHandler
 
 BASEDIR = os.path.dirname(__file__)
index 8efe74cf70929b114be6f502f739e11ea5c8bac0..406d47a8a6f6d42dd17f286852a71e35fbd38744 100644 (file)
@@ -4,8 +4,6 @@ import logging
 import random
 import tornado.web
 
-import backend
-
 from handlers_base import *
 
 class DownloadsIndexHandler(BaseHandler):
index bc3d102f59a93f8d45a081a978d3fdb95e8e8dd1..580a3c738813a2b59712dc18c2e83d01965314be 100644 (file)
@@ -6,10 +6,10 @@ import datetime
 import hwdata
 import logging
 import re
-import simplejson
+import json
 import tornado.web
 
-import backend
+from .. import fireinfo
 
 from handlers_base import *
 
@@ -135,8 +135,8 @@ class FireinfoProfileSendHandler(FireinfoBaseHandler):
 
                # 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.
@@ -160,7 +160,7 @@ class FireinfoProfileSendHandler(FireinfoBaseHandler):
                         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.")
index 4fce56d8926a760b792ceb64a9d35a0cf5d36900..66f982be50c09247f681e6d86bc8bb8ead20efb3 100644 (file)
@@ -7,7 +7,6 @@ import random
 import tornado.web
 
 from handlers_base import *
-import backend
 
 class IUseImage(BaseHandler):
        expires = 3600 * 3
index 0ea9b4d885c6f0ebaee41ca92feb3f107576bd6e..8d3257f957661c404d26a8c3ee6862bb79e91623 100644 (file)
@@ -3,7 +3,7 @@
 import logging
 import textile
 
-import backend
+from .. import database
 
 from handlers_base import *
 
@@ -64,7 +64,7 @@ class RSSNewsHandler(RSSHandler):
                        # 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,
index 945af36eba9bb80a62c7167686460ec09184f9db..67a4d75a08d0b3c46d75a12e6f6a3eb492b019ed 100644 (file)
@@ -13,7 +13,7 @@ import tornado.locale
 import tornado.web
 import unicodedata
 
-import backend
+from .. import database
 
 class UIModule(tornado.web.UIModule):
        @property
@@ -113,7 +113,7 @@ class FireinfoGeoTableModule(UIModule):
                                other_countries.append(name)
                                continue
 
-                       country = backend.database.Row({
+                       country = database.Row({
                                "code"  : code,
                                "name"  : name,
                                "value" : value,