Browse Source

restore backwards compatibility to python 2.5. fixes #104

Natenom/support-murmur-13-1446181288462
Michael Ziegler 15 years ago
parent
commit
6f3b6cc07f
  1. 2
      pyweb/djextdirect.py
  2. 15
      pyweb/mumble/forms.py

2
pyweb/djextdirect.py

@ -157,7 +157,7 @@ class Provider( object ):
if clsname not in self.classes: if clsname not in self.classes:
self.classes[clsname] = {} self.classes[clsname] = {}
self.classes[ clsname ][ method.__name__ ] = method self.classes[ clsname ][ method.__name__ ] = method
method.EXT_argnames = inspect.getargspec( method ).args[1:]
method.EXT_argnames = inspect.getargspec( method )[0][1:]
method.EXT_len = len( method.EXT_argnames ) method.EXT_len = len( method.EXT_argnames )
method.EXT_flags = flags method.EXT_flags = flags
return method return method

15
pyweb/mumble/forms.py

@ -97,7 +97,6 @@ class PropertyModelForm( ModelForm ):
if fldname not in instfields: if fldname not in instfields:
setattr( inst, fldname, self.cleaned_data[fldname] ) setattr( inst, fldname, self.cleaned_data[fldname] )
@EXT_FORMS_PROVIDER.register_form
class MumbleForm( PropertyModelForm ): class MumbleForm( PropertyModelForm ):
""" The Mumble Server admin form that allows to configure settings which do """ The Mumble Server admin form that allows to configure settings which do
not necessarily have to be reserved to the server hoster. not necessarily have to be reserved to the server hoster.
@ -147,6 +146,9 @@ class MumbleForm( PropertyModelForm ):
def EXT_authorize( self, request, action ): def EXT_authorize( self, request, action ):
return self.instance.isUserAdmin( request.user ) return self.instance.isUserAdmin( request.user )
EXT_FORMS_PROVIDER.register_form( MumbleForm )
class MumbleAdminForm( MumbleForm ): class MumbleAdminForm( MumbleForm ):
""" A Mumble Server admin form intended to be used by the server hoster. """ """ A Mumble Server admin form intended to be used by the server hoster. """
@ -200,7 +202,6 @@ class MumbleServerForm( ModelForm ):
class Meta: class Meta:
model = MumbleServer model = MumbleServer
@EXT_FORMS_PROVIDER.register_form
class MumbleUserForm( ModelForm ): class MumbleUserForm( ModelForm ):
""" The user registration form used to register an account. """ """ The user registration form used to register an account. """
@ -263,7 +264,9 @@ class MumbleUserForm( ModelForm ):
model = MumbleUser model = MumbleUser
fields = ( 'name', 'password' ) fields = ( 'name', 'password' )
@EXT_FORMS_PROVIDER.register_form
EXT_FORMS_PROVIDER.register_form( MumbleUserForm )
class MumbleUserPasswordForm( MumbleUserForm ): class MumbleUserPasswordForm( MumbleUserForm ):
""" The user registration form used to register an account on a private server in protected mode. """ """ The user registration form used to register an account on a private server in protected mode. """
@ -295,7 +298,9 @@ class MumbleUserPasswordForm( MumbleUserForm ):
del( self.cleaned_data['serverpw'] ) del( self.cleaned_data['serverpw'] )
return self.cleaned_data return self.cleaned_data
@EXT_FORMS_PROVIDER.register_form
EXT_FORMS_PROVIDER.register_form( MumbleUserPasswordForm )
class MumbleUserLinkForm( MumbleUserForm ): class MumbleUserLinkForm( MumbleUserForm ):
""" Special registration form to either register or link an account. """ """ Special registration form to either register or link an account. """
@ -369,6 +374,8 @@ class MumbleUserLinkForm( MumbleUserForm ):
return self.cleaned_data return self.cleaned_data
EXT_FORMS_PROVIDER.register_form( MumbleUserLinkForm )
class MumbleUserAdminForm( PropertyModelForm ): class MumbleUserAdminForm( PropertyModelForm ):
aclAdmin = forms.BooleanField( required=False ) aclAdmin = forms.BooleanField( required=False )

Loading…
Cancel
Save