[yast-commit] r48722 - in /branches/research/web-service: services/ services/ntp.py settings.py urls.py
Author: jsrain Date: Tue Jul 1 15:41:09 2008 New Revision: 48722 URL: http://svn.opensuse.org/viewcvs/yast?rev=48722&view=rev Log: added a service in a separate file Added: branches/research/web-service/services/ (with props) branches/research/web-service/services/ntp.py Modified: branches/research/web-service/settings.py branches/research/web-service/urls.py Added: branches/research/web-service/services/ntp.py URL: http://svn.opensuse.org/viewcvs/yast/branches/research/web-service/services/ntp.py?rev=48722&view=auto ============================================================================== --- branches/research/web-service/services/ntp.py (added) +++ branches/research/web-service/services/ntp.py Tue Jul 1 15:41:09 2008 @@ -0,0 +1,25 @@ +from django.conf.urls.defaults import * +from django_restapi.model_resource import Collection +from django_restapi.responder import XMLResponder +from django_restapi.resource import Resource +from django.http import HttpResponse +import os +import dbus + + +def getSystemTime2(): + fp = os.popen("date") + systime = fp.read() + fp.close() + return systime + +class SystemTime2(Resource): + def read(self, request): + return HttpResponse(getSystemTime2()) + def update(self, request): + return HttpResponse(request.PUT) + +urlpatterns = patterns('', + (r'^services/time/systemtime', SystemTime2(permitted_methods = ('GET', 'PUT'))), + +) Modified: branches/research/web-service/settings.py URL: http://svn.opensuse.org/viewcvs/yast/branches/research/web-service/settings.py?rev=48722&r1=48721&r2=48722&view=diff ============================================================================== --- branches/research/web-service/settings.py (original) +++ branches/research/web-service/settings.py Tue Jul 1 15:41:09 2008 @@ -11,7 +11,7 @@ 'django.contrib.sites' ) -ROOT_URLCONF = 'urls' +ROOT_URLCONF = 'web-service.urls' MIDDLEWARE_CLASSES = ( 'django.contrib.sessions.middleware.SessionMiddleware', Modified: branches/research/web-service/urls.py URL: http://svn.opensuse.org/viewcvs/yast/branches/research/web-service/urls.py?rev=48722&r1=48721&r2=48722&view=diff ============================================================================== --- branches/research/web-service/urls.py (original) +++ branches/research/web-service/urls.py Tue Jul 1 15:41:09 2008 @@ -56,6 +56,6 @@ (r'^time/systemtime', SystemTime(permitted_methods = ('GET', 'PUT'))), (r'^time/timezone', TimeZone(permitted_methods = ('GET', 'PUT'))), (r'^time/?$', Time(permitted_methods = ('GET', 'POST'))), - (r'^network/?', Network(permitted_methods = ('GET', 'POST'))) - + (r'^network/?', Network(permitted_methods = ('GET', 'POST'))), + (r'', include('web-service.services/ntp')) ) -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org
participants (1)
-
jsrain@svn.opensuse.org