From 27aa07655247f23b0b92900ac2d51d8597e327a5 Mon Sep 17 00:00:00 2001 From: Michael Ziegler Date: Sun, 30 Aug 2009 01:22:57 +0200 Subject: [PATCH] a few style fixes --- pyweb/mumble/MumbleCtlDbus.py | 8 +++--- pyweb/mumble/MumbleCtlIce.py | 12 ++++----- pyweb/mumble/forms.py | 8 +++--- pyweb/mumble/management.py | 4 +-- pyweb/mumble/mctl.py | 46 +++++++++++++++++------------------ pyweb/mumble/mmobjects.py | 9 ++++--- pyweb/mumble/models.py | 17 +++++-------- pyweb/mumble/views.py | 1 - 8 files changed, 50 insertions(+), 55 deletions(-) diff --git a/pyweb/mumble/MumbleCtlDbus.py b/pyweb/mumble/MumbleCtlDbus.py index 6660041..4c00af9 100644 --- a/pyweb/mumble/MumbleCtlDbus.py +++ b/pyweb/mumble/MumbleCtlDbus.py @@ -15,11 +15,11 @@ * GNU General Public License for more details. """ -from PIL import Image -from struct import pack, unpack -from zlib import compress, decompress +from PIL import Image +from struct import pack, unpack +from zlib import compress, decompress -from mctl import MumbleCtlBase +from mctl import MumbleCtlBase import dbus diff --git a/pyweb/mumble/MumbleCtlIce.py b/pyweb/mumble/MumbleCtlIce.py index 2e4cbd0..c5498c2 100644 --- a/pyweb/mumble/MumbleCtlIce.py +++ b/pyweb/mumble/MumbleCtlIce.py @@ -15,14 +15,14 @@ * GNU General Public License for more details. """ -from os.path import join -from PIL import Image -from struct import pack, unpack -from zlib import compress, decompress +from os.path import join +from PIL import Image +from struct import pack, unpack +from zlib import compress, decompress -from django.conf import settings +from django.conf import settings -from mctl import MumbleCtlBase +from mctl import MumbleCtlBase import Ice diff --git a/pyweb/mumble/forms.py b/pyweb/mumble/forms.py index 5d901dc..cca09a6 100644 --- a/pyweb/mumble/forms.py +++ b/pyweb/mumble/forms.py @@ -14,11 +14,11 @@ * GNU General Public License for more details. """ -from django import forms -from django.forms import Form, ModelForm -from django.utils.translation import ugettext_lazy as _ +from django import forms +from django.forms import Form, ModelForm +from django.utils.translation import ugettext_lazy as _ -from models import * +from models import * class MumbleAdminForm( ModelForm ): diff --git a/pyweb/mumble/management.py b/pyweb/mumble/management.py index b31c467..dd444be 100644 --- a/pyweb/mumble/management.py +++ b/pyweb/mumble/management.py @@ -17,9 +17,9 @@ import os import models -from django.db.models import signals +from django.db.models import signals -from mctl import * +from mctl import * def find_in_dicts( keys, conf, default, valueIfNotFound=None ): if not isinstance( keys, tuple ): diff --git a/pyweb/mumble/mctl.py b/pyweb/mumble/mctl.py index 84bc386..43cea6c 100644 --- a/pyweb/mumble/mctl.py +++ b/pyweb/mumble/mctl.py @@ -24,73 +24,73 @@ class MumbleCtlBase (object): def getAllConf(self, srvid): raise NotImplementedError( "mctl::getAllConf" ); - + def getVersion( self ): raise NotImplementedError( "mctl::getVersion" ); def setConf(self, srvid, key, value): raise NotImplementedError( "mctl::setConf" ); - + def getDefaultConf(self): raise NotImplementedError( "mctl::getDefaultConf" ); - + def newServer(self): raise NotImplementedError( "mctl::newServer" ); - + def setSuperUserPassword(self, srvid, value): raise NotImplementedError( "mctl::setSuperUserPassword" ); - + def start(self, srvid): raise NotImplementedError( "mctl::start" ); - + def stop(self, srvid): raise NotImplementedError( "mctl::stop" ); - + def isBooted(self, srvid): raise NotImplementedError( "mctl::isBooted" ); - + def deleteServer(self, srvid): raise NotImplementedError( "mctl::deleteServer" ); - + def getPlayers(self, srvid): raise NotImplementedError( "mctl::getPlayers" ); - + def getRegisteredPlayers(self, srvid, filter): raise NotImplementedError( "mctl::getRegisteredPlayers" ); - + def getChannels(self, srvid): raise NotImplementedError( "mctl::getChannels" ); - + def registerPlayer(self, srvid, name, email, password): raise NotImplementedError( "mctl::registerPlayer" ); - + def getRegistration(self, srvid, mumbleid): - raise NotImplementedError( "mctl::setRegistration" ); - + raise NotImplementedError( "mctl::getRegistration" ); + def setRegistration(self, srvid, mumbleid, name, email, password): raise NotImplementedError( "mctl::setRegistration" ); - + def unregisterPlayer(self, srvid, mumbleid): raise NotImplementedError( "mctl::unregisterPlayer" ); - + def getBootedServers(self): raise NotImplementedError( "mctl::getBootedServers" ); - + def getAllServers(self): raise NotImplementedError( "mctl::getAllServers" ); - + def getACL(self, srvid, channelid): raise NotImplementedError( "mctl::getACL" ); - + def setACL(self, srvid, acl): raise NotImplementedError( "mctl::setACL" ); - + def getTexture(self, srvid, mumbleid): raise NotImplementedError( "mctl::getTexture" ); - + def setTexture(self, srvid, mumbleid, infile): raise NotImplementedError( "mctl::setTexture" ); - + @staticmethod def newInstance( connstring ): # check cache diff --git a/pyweb/mumble/mmobjects.py b/pyweb/mumble/mmobjects.py index 7a82a16..a547dc0 100644 --- a/pyweb/mumble/mmobjects.py +++ b/pyweb/mumble/mmobjects.py @@ -17,11 +17,12 @@ import mctl import datetime -from time import time -from os.path import join +from time import time +from os.path import join + +from django.utils.http import urlquote +from django.conf import settings -from django.utils.http import urlquote -from django.conf import settings def cmp_names( a, b ): return cmp( a.name, b.name ); diff --git a/pyweb/mumble/models.py b/pyweb/mumble/models.py index a45ec3c..29127cf 100644 --- a/pyweb/mumble/models.py +++ b/pyweb/mumble/models.py @@ -15,18 +15,15 @@ """ import socket -from PIL import Image -from struct import pack, unpack -from zlib import compress, decompress -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import ugettext_lazy as _ from django.contrib.auth.models import User -from django.db import models +from django.db import models +from django.db.models import signals +from django.conf import settings -from django.conf import settings - -from mmobjects import * -from mctl import * +from mmobjects import * +from mctl import * class Mumble( models.Model ): @@ -405,8 +402,6 @@ class MumbleUser( models.Model ): -from django.db.models import signals - signals.pre_delete.connect( Mumble.pre_delete_listener, sender=Mumble ); signals.pre_delete.connect( MumbleUser.pre_delete_listener, sender=MumbleUser ); diff --git a/pyweb/mumble/views.py b/pyweb/mumble/views.py index e6493e8..9765104 100644 --- a/pyweb/mumble/views.py +++ b/pyweb/mumble/views.py @@ -20,7 +20,6 @@ from StringIO import StringIO from django.shortcuts import render_to_response, get_object_or_404, get_list_or_404 from django.template import RequestContext from django.http import Http404, HttpResponse, HttpResponseRedirect -from django.core.urlresolvers import reverse from django.contrib.auth.decorators import login_required from django.contrib.auth.models import User from django.conf import settings