aboutsummaryrefslogtreecommitdiff
path: root/okupy
diff options
context:
space:
mode:
authorTheo Chatzimichos <tampakrap@gentoo.org>2013-08-25 10:23:56 +0200
committerTheo Chatzimichos <tampakrap@gentoo.org>2013-08-25 23:33:29 +0200
commitba140915859e0335170638470e35d8d81862c7db (patch)
treee25957e441d04199360919862f15ceb510e4b850 /okupy
parentMove OkupyError to okupy/__init__ (diff)
downloadidentity.gentoo.org-ba140915859e0335170638470e35d8d81862c7db.tar.gz
identity.gentoo.org-ba140915859e0335170638470e35d8d81862c7db.tar.bz2
identity.gentoo.org-ba140915859e0335170638470e35d8d81862c7db.zip
switch back to non-relative imports, they proved to be confusing
Diffstat (limited to 'okupy')
-rw-r--r--okupy/accounts/forms.py4
-rw-r--r--okupy/accounts/models.py2
-rw-r--r--okupy/accounts/openid_store.py2
-rw-r--r--okupy/accounts/ssh.py8
-rw-r--r--okupy/accounts/urls.py2
-rw-r--r--okupy/accounts/views.py31
-rw-r--r--okupy/common/auth.py2
-rw-r--r--okupy/common/ldap_helpers.py4
-rw-r--r--okupy/crypto/ciphers.py2
-rw-r--r--okupy/crypto/models.py2
-rw-r--r--okupy/otp/__init__.py4
-rw-r--r--okupy/otp/sotp/models.py2
-rw-r--r--okupy/otp/totp/models.py4
-rw-r--r--okupy/tests/integration/test_index.py4
-rw-r--r--okupy/tests/integration/test_lists.py4
-rw-r--r--okupy/tests/integration/test_login.py4
-rw-r--r--okupy/tests/integration/test_signup.py3
-rw-r--r--okupy/tests/unit/test_auth.py4
-rw-r--r--okupy/tests/unit/test_cipher.py2
-rw-r--r--okupy/tests/unit/test_index.py6
-rw-r--r--okupy/tests/unit/test_lists.py6
-rw-r--r--okupy/tests/unit/test_login.py10
-rw-r--r--okupy/tests/unit/test_openid.py2
-rw-r--r--okupy/tests/unit/test_secondary_password.py8
-rw-r--r--okupy/tests/unit/test_signup.py10
-rw-r--r--okupy/tests/unit/test_ssh.py6
-rw-r--r--okupy/tests/vars.py2
-rw-r--r--okupy/urls.py2
28 files changed, 72 insertions, 70 deletions
diff --git a/okupy/accounts/forms.py b/okupy/accounts/forms.py
index be6e1e8..a5a7b25 100644
--- a/okupy/accounts/forms.py
+++ b/okupy/accounts/forms.py
@@ -2,8 +2,8 @@
from django import forms
-from .models import OpenID_Attributes
-from ..crypto.ciphers import sessionrefcipher
+from okupy.accounts.models import OpenID_Attributes
+from okupy.crypto.ciphers import sessionrefcipher
class LoginForm(forms.Form):
diff --git a/okupy/accounts/models.py b/okupy/accounts/models.py
index 3f41705..b56c20f 100644
--- a/okupy/accounts/models.py
+++ b/okupy/accounts/models.py
@@ -6,7 +6,7 @@ from ldapdb.models.fields import (CharField, IntegerField, ListField,
FloatField, ACLField, DateField)
import ldapdb.models
-from ..crypto.models import EncryptedPKModel
+from okupy.crypto.models import EncryptedPKModel
class Queue(EncryptedPKModel):
diff --git a/okupy/accounts/openid_store.py b/okupy/accounts/openid_store.py
index 5f66abb..cce93f7 100644
--- a/okupy/accounts/openid_store.py
+++ b/okupy/accounts/openid_store.py
@@ -12,7 +12,7 @@ from openid.store.interface import OpenIDStore
from openid.association import Association
from openid.store import nonce
-from . import models as db_models
+from okupy.accounts import models as db_models
class DjangoDBOpenIDStore(OpenIDStore):
diff --git a/okupy/accounts/ssh.py b/okupy/accounts/ssh.py
index 4e5028e..6383c49 100644
--- a/okupy/accounts/ssh.py
+++ b/okupy/accounts/ssh.py
@@ -2,10 +2,10 @@
from django.contrib.auth import authenticate, login
-from ..common.ssh import ssh_handler
-from ..common.test_helpers import set_request
-from ..crypto.ciphers import sessionrefcipher
-from ..otp import init_otp
+from okupy.common.ssh import ssh_handler
+from okupy.common.test_helpers import set_request
+from okupy.crypto.ciphers import sessionrefcipher
+from okupy.otp import init_otp
ssh_handlers = {}
diff --git a/okupy/accounts/urls.py b/okupy/accounts/urls.py
index 56e56a6..345596b 100644
--- a/okupy/accounts/urls.py
+++ b/okupy/accounts/urls.py
@@ -1,7 +1,7 @@
# vim:fileencoding=utf8:et:ts=4:sts=4:sw=4:ft=python
from django.conf.urls import patterns, url
-from . import views as v
+from okupy.accounts import views as v
accounts_urlpatterns = patterns('',
url(r'^$', v.index, name="index"),
diff --git a/okupy/accounts/views.py b/okupy/accounts/views.py
index 17d83f2..e5acdc0 100644
--- a/okupy/accounts/views.py
+++ b/okupy/accounts/views.py
@@ -27,21 +27,22 @@ from openid.server.server import (Server, ProtocolError, EncodingError,
from passlib.hash import ldap_md5_crypt
from urlparse import urljoin, urlparse, parse_qsl
-from .forms import (LoginForm, OpenIDLoginForm, SSLCertLoginForm,
- OTPForm, SignupForm, SiteAuthForm, StrongAuthForm)
-from .models import LDAPUser, OpenID_Attributes, Queue
-from .openid_store import DjangoDBOpenIDStore
-from ..common.ldap_helpers import (get_bound_ldapuser,
- set_secondary_password,
- remove_secondary_password)
-from .. import OkupyError
-from ..common.decorators import strong_auth_required, anonymous_required
-from ..common.log import log_extra_data
-from ..crypto.ciphers import sessionrefcipher
-from ..crypto.models import RevokedToken
-from ..otp import init_otp
-from ..otp.sotp.models import SOTPDevice
-from ..otp.totp.models import TOTPDevice
+from okupy import OkupyError
+from okupy.accounts.forms import (LoginForm, OpenIDLoginForm, SSLCertLoginForm,
+ OTPForm, SignupForm, SiteAuthForm,
+ StrongAuthForm)
+from okupy.accounts.models import LDAPUser, OpenID_Attributes, Queue
+from okupy.accounts.openid_store import DjangoDBOpenIDStore
+from okupy.common.ldap_helpers import (get_bound_ldapuser,
+ set_secondary_password,
+ remove_secondary_password)
+from okupy.common.decorators import strong_auth_required, anonymous_required
+from okupy.common.log import log_extra_data
+from okupy.crypto.ciphers import sessionrefcipher
+from okupy.crypto.models import RevokedToken
+from okupy.otp import init_otp
+from okupy.otp.sotp.models import SOTPDevice
+from okupy.otp.totp.models import TOTPDevice
# the following two are for exceptions
import openid.yadis.discover
diff --git a/okupy/common/auth.py b/okupy/common/auth.py
index 9d4b205..aa238fc 100644
--- a/okupy/common/auth.py
+++ b/okupy/common/auth.py
@@ -4,7 +4,7 @@ from django.contrib.auth import get_user_model
from django.contrib.auth.backends import ModelBackend
from django.db import IntegrityError
-from ..accounts.models import LDAPUser
+from okupy.accounts.models import LDAPUser
from OpenSSL.crypto import load_certificate, FILETYPE_PEM
diff --git a/okupy/common/ldap_helpers.py b/okupy/common/ldap_helpers.py
index 4970e6a..817c786 100644
--- a/okupy/common/ldap_helpers.py
+++ b/okupy/common/ldap_helpers.py
@@ -4,8 +4,8 @@ from base64 import b64encode
from Crypto import Random
from passlib.hash import ldap_md5_crypt
-from ..crypto.ciphers import cipher
-from ..accounts.models import LDAPUser
+from okupy.crypto.ciphers import cipher
+from okupy.accounts.models import LDAPUser
def get_bound_ldapuser(request, password=None):
diff --git a/okupy/crypto/ciphers.py b/okupy/crypto/ciphers.py
index 667d8d1..cdafba6 100644
--- a/okupy/crypto/ciphers.py
+++ b/okupy/crypto/ciphers.py
@@ -10,7 +10,7 @@ import Crypto.Random
import struct
-from .codecs import ub64encode, ub64decode
+from okupy.crypto.codecs import ub64encode, ub64decode
class OkupyCipher(object):
diff --git a/okupy/crypto/models.py b/okupy/crypto/models.py
index b2eaa08..8f30130 100644
--- a/okupy/crypto/models.py
+++ b/okupy/crypto/models.py
@@ -4,7 +4,7 @@ from django.contrib.auth.models import User
from django.db import models, IntegrityError
from django.utils.timezone import now
-from .ciphers import idcipher
+from okupy.crypto.ciphers import idcipher
from datetime import timedelta
diff --git a/okupy/otp/__init__.py b/okupy/otp/__init__.py
index 7a538f3..51c7f65 100644
--- a/okupy/otp/__init__.py
+++ b/okupy/otp/__init__.py
@@ -4,8 +4,8 @@ from django.db import IntegrityError
from django_otp import login as otp_login
from django_otp.middleware import OTPMiddleware
-from .sotp.models import SOTPDevice
-from .totp.models import TOTPDevice
+from okupy.otp.sotp.models import SOTPDevice
+from okupy.otp.totp.models import TOTPDevice
def init_otp(request):
"""
diff --git a/okupy/otp/sotp/models.py b/okupy/otp/sotp/models.py
index 5bb58f8..d986928 100644
--- a/okupy/otp/sotp/models.py
+++ b/okupy/otp/sotp/models.py
@@ -2,7 +2,7 @@
from django_otp.models import Device
-from ...accounts.models import LDAPUser
+from okupy.accounts.models import LDAPUser
import random
diff --git a/okupy/otp/totp/models.py b/okupy/otp/totp/models.py
index 72f5e3d..28afbf0 100644
--- a/okupy/otp/totp/models.py
+++ b/okupy/otp/totp/models.py
@@ -3,8 +3,8 @@
from django_otp import oath
from django_otp.models import Device
-from ...accounts.models import LDAPUser
-from ...crypto.codecs import ub32decode, ub32encode
+from okupy.accounts.models import LDAPUser
+from okupy.crypto.codecs import ub32decode, ub32encode
import Crypto.Random
diff --git a/okupy/tests/integration/test_index.py b/okupy/tests/integration/test_index.py
index 8650860..ec5626f 100644
--- a/okupy/tests/integration/test_index.py
+++ b/okupy/tests/integration/test_index.py
@@ -4,8 +4,8 @@ from django.conf import settings
from django.test.client import Client
from mockldap import MockLdap
-from .. import vars
-from ...common.test_helpers import OkupyTestCase, ldap_users, set_search_seed
+from okupy.common.test_helpers import OkupyTestCase, ldap_users, set_search_seed
+from okupy.tests import vars
class IndexIntegrationTests(OkupyTestCase):
diff --git a/okupy/tests/integration/test_lists.py b/okupy/tests/integration/test_lists.py
index f75bd78..d7b47cb 100644
--- a/okupy/tests/integration/test_lists.py
+++ b/okupy/tests/integration/test_lists.py
@@ -7,8 +7,8 @@ from django.test.client import Client
from mockldap import MockLdap
-from .. import vars
-from ...common.test_helpers import ldap_users, set_search_seed
+from okupy.common.test_helpers import ldap_users, set_search_seed
+from okupy.tests import vars
class ListsIntegrationTests(TestCase):
@classmethod
diff --git a/okupy/tests/integration/test_login.py b/okupy/tests/integration/test_login.py
index 9ab30df..eb35aa5 100644
--- a/okupy/tests/integration/test_login.py
+++ b/okupy/tests/integration/test_login.py
@@ -6,8 +6,8 @@ from django.test.client import Client
from mockldap import MockLdap
-from .. import vars
-from ...common.test_helpers import ldap_users, set_search_seed
+from okupy.common.test_helpers import ldap_users, set_search_seed
+from okupy.tests import vars
class LoginIntegrationTests(TestCase):
diff --git a/okupy/tests/integration/test_signup.py b/okupy/tests/integration/test_signup.py
index b6e641d..6deef91 100644
--- a/okupy/tests/integration/test_signup.py
+++ b/okupy/tests/integration/test_signup.py
@@ -5,7 +5,8 @@ from django.test import TestCase
from django.test.client import Client
from mockldap import MockLdap
-from .. import vars
+from okupy.accounts.models import LDAPUser
+from okupy.tests import vars
class SignupIntegrationTests(TestCase):
diff --git a/okupy/tests/unit/test_auth.py b/okupy/tests/unit/test_auth.py
index 7c445f6..d514999 100644
--- a/okupy/tests/unit/test_auth.py
+++ b/okupy/tests/unit/test_auth.py
@@ -6,8 +6,8 @@ from django.conf import settings
from django.contrib.auth import authenticate
from django.test import TestCase
-from .. import vars
-from ...common.test_helpers import ldap_users, set_request
+from okupy.common.test_helpers import ldap_users, set_request
+from okupy.tests import vars
import base64
diff --git a/okupy/tests/unit/test_cipher.py b/okupy/tests/unit/test_cipher.py
index 0589dfd..a306610 100644
--- a/okupy/tests/unit/test_cipher.py
+++ b/okupy/tests/unit/test_cipher.py
@@ -5,7 +5,7 @@ from unittest import TestCase, SkipTest
from django.contrib.sessions.backends.cache import SessionStore
-from ...crypto.ciphers import cipher, sessionrefcipher
+from okupy.crypto.ciphers import cipher, sessionrefcipher
class OkupyCipherTests(TestCase):
diff --git a/okupy/tests/unit/test_index.py b/okupy/tests/unit/test_index.py
index eb6861e..b35d99a 100644
--- a/okupy/tests/unit/test_index.py
+++ b/okupy/tests/unit/test_index.py
@@ -6,9 +6,9 @@ from django.test import TestCase
from mockldap import MockLdap
-from .. import vars
-from ...accounts.views import index
-from ...common.test_helpers import set_request
+from okupy.accounts.views import index
+from okupy.common.test_helpers import set_request
+from okupy.tests import vars
class IndexUnitTests(TestCase):
diff --git a/okupy/tests/unit/test_lists.py b/okupy/tests/unit/test_lists.py
index 04803f9..c05db38 100644
--- a/okupy/tests/unit/test_lists.py
+++ b/okupy/tests/unit/test_lists.py
@@ -5,9 +5,9 @@ from django.core.urlresolvers import resolve
from mockldap import MockLdap
-from .. import vars
-from ...accounts.views import lists
-from ...common.test_helpers import OkupyTestCase, set_request
+from okupy.accounts.views import lists
+from okupy.common.test_helpers import OkupyTestCase, set_request
+from okupy.tests import vars
class ListsUnitTests(OkupyTestCase):
diff --git a/okupy/tests/unit/test_login.py b/okupy/tests/unit/test_login.py
index d674150..65e8d8d 100644
--- a/okupy/tests/unit/test_login.py
+++ b/okupy/tests/unit/test_login.py
@@ -12,11 +12,11 @@ from Crypto import Random
from passlib.hash import ldap_md5_crypt
from mockldap import MockLdap
-from .. import vars
-from ...accounts.views import login, logout
-from ...accounts.forms import LoginForm
-from ...common.test_helpers import OkupyTestCase, set_request, no_database, ldap_users
-from ...crypto.ciphers import cipher
+from okupy.accounts.views import login, logout
+from okupy.accounts.forms import LoginForm
+from okupy.common.test_helpers import OkupyTestCase, set_request, no_database, ldap_users
+from okupy.crypto.ciphers import cipher
+from okupy.tests import vars
class LoginUnitTests(OkupyTestCase):
diff --git a/okupy/tests/unit/test_openid.py b/okupy/tests/unit/test_openid.py
index 4d5a75a..478d9b9 100644
--- a/okupy/tests/unit/test_openid.py
+++ b/okupy/tests/unit/test_openid.py
@@ -2,7 +2,7 @@
from django.test import TestCase
-from ...accounts.openid_store import DjangoDBOpenIDStore
+from okupy.accounts.openid_store import DjangoDBOpenIDStore
import time
diff --git a/okupy/tests/unit/test_secondary_password.py b/okupy/tests/unit/test_secondary_password.py
index 885c3cb..ffe95dd 100644
--- a/okupy/tests/unit/test_secondary_password.py
+++ b/okupy/tests/unit/test_secondary_password.py
@@ -8,10 +8,10 @@ from Crypto import Random
from mockldap import MockLdap
from passlib.hash import ldap_md5_crypt
-from .. import vars
-from ...common.ldap_helpers import set_secondary_password, remove_secondary_password
-from ...common.test_helpers import set_request, set_search_seed, ldap_users
-from ...crypto.ciphers import cipher
+from okupy.common.ldap_helpers import set_secondary_password, remove_secondary_password
+from okupy.common.test_helpers import set_request, set_search_seed, ldap_users
+from okupy.crypto.ciphers import cipher
+from okupy.tests import vars
class SecondaryPassword(TestCase):
diff --git a/okupy/tests/unit/test_signup.py b/okupy/tests/unit/test_signup.py
index 2f4485d..da741ae 100644
--- a/okupy/tests/unit/test_signup.py
+++ b/okupy/tests/unit/test_signup.py
@@ -8,11 +8,11 @@ from django.template import RequestContext
from mockldap import MockLdap
from passlib.hash import ldap_md5_crypt
-from .. import vars
-from ...accounts.forms import SignupForm
-from ...accounts.models import LDAPUser, Queue
-from ...accounts.views import signup, activate
-from ...common.test_helpers import OkupyTestCase, set_request, no_database, ldap_users
+from okupy.accounts.forms import SignupForm
+from okupy.accounts.models import LDAPUser, Queue
+from okupy.accounts.views import signup, activate
+from okupy.common.test_helpers import OkupyTestCase, set_request, ldap_users, no_database
+from okupy.tests import vars
class SignupUnitTests(OkupyTestCase):
diff --git a/okupy/tests/unit/test_ssh.py b/okupy/tests/unit/test_ssh.py
index 6e0610d..2c00949 100644
--- a/okupy/tests/unit/test_ssh.py
+++ b/okupy/tests/unit/test_ssh.py
@@ -9,9 +9,9 @@ import socket
import paramiko
-from ..vars import TEST_SSH_KEY_FOR_NO_USER
-from ... import OkupyError
-from ...common.ssh import ssh_handler, SSHServer
+from okupy import OkupyError
+from okupy.common.ssh import ssh_handler, SSHServer
+from okupy.tests.vars import TEST_SSH_KEY_FOR_NO_USER
@override_settings(SSH_HANDLERS={})
diff --git a/okupy/tests/vars.py b/okupy/tests/vars.py
index c2e9152..afe5062 100644
--- a/okupy/tests/vars.py
+++ b/okupy/tests/vars.py
@@ -5,7 +5,7 @@
from django.conf import settings
from django.contrib.auth.models import User
-from ..accounts.models import Queue
+from okupy.accounts.models import Queue
# LDAP directory
diff --git a/okupy/urls.py b/okupy/urls.py
index 8e217bf..8b10849 100644
--- a/okupy/urls.py
+++ b/okupy/urls.py
@@ -1,7 +1,7 @@
# vim:fileencoding=utf8:et:ts=4:sts=4:sw=4:ft=python
from django.conf.urls import patterns, include
-from .accounts.urls import accounts_urlpatterns
+from okupy.accounts.urls import accounts_urlpatterns
urlpatterns = patterns('',
(r'^', include(accounts_urlpatterns)),