# Patchwork XMLRPC interface
#
-from django.core.exceptions import ImproperlyConfigured
from SimpleXMLRPCServer import SimpleXMLRPCDispatcher
from django.http import HttpResponse, HttpResponseRedirect, \
HttpResponseServerError
-from django.conf import settings
from django.core import urlresolvers
-from django.shortcuts import render_to_response
from django.contrib.auth import authenticate
-from patchwork.models import Patch, Project, Person, Bundle, State
+from patchwork.models import Patch, Project, Person, State
from django.views.decorators.csrf import csrf_exempt
import sys
def _user_for_request(self, request):
auth_header = None
- if request.META.has_key('HTTP_AUTHORIZATION'):
+ if 'HTTP_AUTHORIZATION' in request.META:
auth_header = request.META.get('HTTP_AUTHORIZATION')
- elif request.META.has_key('Authorization'):
+ elif 'Authorization' in request.META:
auth_header = request.META.get('Authorization')
if auth_header is None or auth_header == '':
try:
ret = dispatcher._marshaled_dispatch(request)
response.write(ret)
- except Exception, e:
+ except Exception:
return HttpResponseServerError()
return response
patches = Patch.objects.filter(**dfilter)
if max_count > 0:
- return map(patch_to_dict, patches)[:max_count]
+ return map(patch_to_dict, patches[:max_count])
else:
return map(patch_to_dict, patches)