Enable absolute imports.

See PEP 328[1] for details. This feature was introduced in Python 2.5 and
will become mandatory in Python 3.

[1]: http://www.python.org/dev/peps/pep-0328

(imported from commit 7444eeba8a08d5f91b94c7921848f2274979bd76)
This commit is contained in:
Luke Faraone 2013-04-23 09:51:17 -07:00
parent b1dd0ae09c
commit 71a91197fa
68 changed files with 137 additions and 5 deletions

View File

@ -1,3 +1,5 @@
from __future__ import absolute_import
from django.conf import settings
def add_settings(request):

View File

@ -1,3 +1,5 @@
from __future__ import absolute_import
from django.views.decorators.csrf import csrf_exempt
from django.views.decorators.http import require_POST
from django.http import QueryDict

View File

@ -1,3 +1,5 @@
from __future__ import absolute_import
from django.views.debug import SafeExceptionReporterFilter
from django.http import build_request_repr

View File

@ -1,3 +1,5 @@
from __future__ import absolute_import
from django import forms
from django.core import validators
from django.core.exceptions import ValidationError

View File

@ -1,3 +1,5 @@
from __future__ import absolute_import
import sys
import logging
import traceback

View File

@ -1,3 +1,5 @@
from __future__ import absolute_import
from django.conf import settings
from django.contrib.sessions.models import Session
from zephyr.lib.context_managers import lockfile

View File

@ -1,5 +1,7 @@
from __future__ import absolute_import
import hashlib
from utils import make_safe_digest
from zephyr.lib.utils import make_safe_digest
def gravatar_hash(email):
"""Compute the Gravatar hash for an email address."""

View File

@ -1,3 +1,5 @@
from __future__ import absolute_import
from django.conf import settings
from zephyr.lib.initial_password import initial_password, initial_api_key

View File

@ -1,11 +1,11 @@
from __future__ import absolute_import
from functools import wraps
from django.core.cache import cache as djcache
from django.core.cache import get_cache
from utils import make_safe_digest
from zephyr.lib.utils import statsd, statsd_key
from zephyr.lib.utils import statsd, statsd_key, make_safe_digest
def cache_with_key(keyfunc, cache_name=None, timeout=None):
"""Decorator which applies Django caching to a function.

View File

@ -1,3 +1,5 @@
from __future__ import absolute_import
# This file needs to be different from cache.py because cache.py
# cannot import anything from zephyr.models or we'd have an import
# loop

View File

@ -2,6 +2,8 @@
Context managers, i.e. things you can use with the 'with' statement.
"""
from __future__ import absolute_import
import fcntl
from os import path
from contextlib import contextmanager

View File

@ -1,3 +1,5 @@
from __future__ import absolute_import
from django.conf import settings
from django.contrib.auth.models import UserManager
from django.utils import timezone

View File

@ -1,3 +1,5 @@
from __future__ import absolute_import
import code
import traceback
import signal

View File

@ -1,3 +1,5 @@
from __future__ import absolute_import
from django.conf import settings
from collections import deque
import os

View File

@ -1,3 +1,5 @@
from __future__ import absolute_import
from django.conf import settings
import hashlib

View File

@ -1,3 +1,5 @@
from __future__ import absolute_import
from django.conf import settings
from hashlib import sha1
from os import path

View File

@ -1,3 +1,5 @@
from __future__ import absolute_import
import os
import pty
import sys

View File

@ -1,3 +1,5 @@
from __future__ import absolute_import
def last_n(n, query_set):
"""Get the last n results from a Django QuerySet, in a semi-efficient way.
Returns a list."""

View File

@ -1,3 +1,5 @@
from __future__ import absolute_import
from django.conf import settings
import pika
import logging

View File

@ -1,3 +1,5 @@
from __future__ import absolute_import
from django.http import HttpResponse, HttpResponseNotAllowed
import simplejson

View File

@ -1,3 +1,5 @@
from __future__ import absolute_import
from django.conf import settings
import os
import logging

View File

@ -1,3 +1,5 @@
from __future__ import absolute_import
import time
import ctypes
import threading

View File

@ -1,3 +1,5 @@
from __future__ import absolute_import
import datetime
import calendar
from django.utils.timezone import utc

View File

@ -1,3 +1,5 @@
from __future__ import absolute_import
import logging
import time
from tornado import ioloop

View File

@ -1,3 +1,5 @@
from __future__ import absolute_import
import re
import bisect
import simplejson

View File

@ -1,4 +1,6 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import
import hashlib
from time import sleep, time
from django.conf import settings

View File

@ -1,3 +1,5 @@
from __future__ import absolute_import
from optparse import make_option
from django.core.management.base import BaseCommand
from confirmation.models import Confirmation

View File

@ -1,3 +1,5 @@
from __future__ import absolute_import
from optparse import make_option
from django.core.management.base import BaseCommand

View File

@ -1,3 +1,5 @@
from __future__ import absolute_import
from optparse import make_option
from django.core.management.base import BaseCommand
from zephyr.models import Realm, UserProfile, Recipient, Message, get_client

View File

@ -1,3 +1,5 @@
from __future__ import absolute_import
from django.core.management.base import BaseCommand
from zephyr.lib.actions import do_change_user_email

View File

@ -1,3 +1,5 @@
from __future__ import absolute_import
from django.core.management.base import NoArgsCommand
from zephyr.models import clear_database

View File

@ -1,3 +1,5 @@
from __future__ import absolute_import
from optparse import make_option
from django.core.management.base import BaseCommand

View File

@ -1,3 +1,5 @@
from __future__ import absolute_import
from django.core.management.base import BaseCommand
from zephyr.models import StreamColor, Subscription

View File

@ -1,3 +1,5 @@
from __future__ import absolute_import
from django.core.management.base import BaseCommand
from zephyr.lib.actions import do_create_realm

View File

@ -1,3 +1,5 @@
from __future__ import absolute_import
import sys
from optparse import make_option

View File

@ -1,3 +1,5 @@
from __future__ import absolute_import
from optparse import make_option
from django.core.management.base import BaseCommand

View File

@ -1,3 +1,5 @@
from __future__ import absolute_import
from django.core.management.base import BaseCommand
from zephyr.models import Subscription, Recipient, Message, Stream, \
get_user_profile_by_email

View File

@ -1,3 +1,5 @@
from __future__ import absolute_import
from optparse import make_option
from django.core.management.base import BaseCommand
from zephyr.models import UserProfile, get_user_profile_by_email

View File

@ -1,3 +1,5 @@
from __future__ import absolute_import
from optparse import make_option
from django.core.management.base import BaseCommand
from zephyr.models import Realm, UserProfile, Message, UserMessage, \

View File

@ -1,3 +1,5 @@
from __future__ import absolute_import
from optparse import make_option
from django.core.management.base import BaseCommand
from zephyr.models import Realm, UserActivity, get_client, \

View File

@ -1,3 +1,5 @@
from __future__ import absolute_import
import os
import sys
import select

View File

@ -1,3 +1,5 @@
from __future__ import absolute_import
from django.core.management.base import BaseCommand
from zephyr.retention_policy import get_UserMessages_to_expunge
from zephyr.models import Message

View File

@ -1,3 +1,5 @@
from __future__ import absolute_import
import os
import sys
import datetime

View File

@ -1,3 +1,5 @@
from __future__ import absolute_import
from optparse import make_option
from django.core.management.base import BaseCommand
from zephyr.lib.cache_helpers import fill_memcached_cache, cache_fillers

View File

@ -1,3 +1,5 @@
from __future__ import absolute_import
from optparse import make_option
from django.contrib.sites.models import Site
from django.core.management.base import BaseCommand

View File

@ -1,3 +1,5 @@
from __future__ import absolute_import
from optparse import make_option
from django.core.management.base import BaseCommand

View File

@ -1,3 +1,5 @@
from __future__ import absolute_import
from django.core.management.base import BaseCommand
from django.utils.timezone import utc, now

View File

@ -1,3 +1,5 @@
from __future__ import absolute_import
from django.core.management.base import BaseCommand
from zephyr.lib.initial_password import initial_password, initial_api_key

View File

@ -1,3 +1,5 @@
from __future__ import absolute_import
from optparse import make_option
from django.core.management.base import BaseCommand
import simplejson

View File

@ -1,3 +1,5 @@
from __future__ import absolute_import
import datetime
import pytz

View File

@ -1,3 +1,5 @@
from __future__ import absolute_import
from optparse import make_option
from django.core.management.base import BaseCommand

View File

@ -1,3 +1,5 @@
from __future__ import absolute_import
from django.core.management.base import BaseCommand
from zephyr.models import Subscription, Recipient, get_user_profile_by_email

View File

@ -1,3 +1,5 @@
from __future__ import absolute_import
from django.conf import settings
settings.RUNNING_INSIDE_TORNADO = True
# We must call zephyr.lib.tornado_ioloop_logging.instrument_tornado_ioloop

View File

@ -1,3 +1,5 @@
from __future__ import absolute_import
from django.core.management.base import BaseCommand
from zephyr.models import get_user_profile_by_email, get_prereg_user_by_email

View File

@ -1,3 +1,5 @@
from __future__ import absolute_import
from django.core.management.base import BaseCommand
from django.conf import settings

View File

@ -1,3 +1,5 @@
from __future__ import absolute_import
from optparse import make_option
import logging
import sys

View File

@ -1,3 +1,5 @@
from __future__ import absolute_import
from optparse import make_option
import logging

View File

@ -1,3 +1,5 @@
from __future__ import absolute_import
import simplejson
from postmonkey import PostMonkey
from django.core.management.base import BaseCommand

View File

@ -1,3 +1,5 @@
from __future__ import absolute_import
from optparse import make_option
from django.core.management.base import BaseCommand

View File

@ -1,3 +1,5 @@
from __future__ import absolute_import
import datetime
import pytz

View File

@ -1,5 +1,7 @@
from __future__ import absolute_import
from django.conf import settings
from decorator import RequestVariableMissingError, RequestVariableConversionError
from zephyr.decorator import RequestVariableMissingError, RequestVariableConversionError
from zephyr.lib.response import json_error
from django.db import connection
from zephyr.lib.utils import statsd

View File

@ -1,3 +1,5 @@
from __future__ import absolute_import
from django.db import models
from django.conf import settings
from django.contrib.auth.models import AbstractBaseUser, UserManager

View File

@ -1,3 +1,5 @@
from __future__ import absolute_import
# Defer importing until later to avoid circular imports
def openid_failure_handler(request, message, status=403, template_name=None, exception=None):

View File

@ -9,6 +9,7 @@ rather than iterating through messages one by one.
The code in this module does not actually remove anything; it just identifies
which items should be kept or removed.
"""
from __future__ import absolute_import
import operator

View File

@ -1,4 +1,5 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from django.test import TestCase
from django.test.simple import DjangoTestSuiteRunner

View File

@ -1,3 +1,5 @@
from __future__ import absolute_import
from django.conf import settings
from zephyr.models import Message, UserProfile, UserMessage, \
Recipient, Stream, get_stream

View File

@ -1,3 +1,5 @@
from __future__ import absolute_import
from django.conf import settings
from zephyr.models import UserActivity

View File

@ -1,3 +1,5 @@
from __future__ import absolute_import
from django.conf import settings
from django.contrib.auth import authenticate, login
from django.contrib.auth.decorators import login_required