WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH] blktap2: Remove function decorators for Python 2.3

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH] blktap2: Remove function decorators for Python 2.3
From: "KUWAMURA Shin'ya" <kuwa@xxxxxxxxxxxxxx>
Date: Thu, 29 Jul 2010 11:33:07 +0900 (JST)
Delivery-date: Wed, 28 Jul 2010 19:36:22 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Hi,

Function decorators were introduced in Python 2.4.
This patch removes @staticmethod using staticmethod() for Python 2.3.

Signed-off-by: KUWAMURA Shin'ya <kuwa@xxxxxxxxxxxxxx>
-- 
  KUWAMURA Shin'ya
# HG changeset patch
# User KUWAMURA Shin'ya <kuwa@xxxxxxxxxxxxxx>
# Date 1277793380 -32400
# Node ID a9528a01c846d9d15ed9190474413a96e765733c
# Parent  7b00193bd0334606b6f6779c3f14a1667a952fe4
blktap2: Remove function decorators for Python 2.3

Function decorators were introduced in Python 2.4.
This patch removes @staticmethod using staticmethod() for Python 2.3.

Signed-off-by: KUWAMURA Shin'ya <kuwa@xxxxxxxxxxxxxx>

diff -r 7b00193bd033 -r a9528a01c846 
tools/python/xen/xend/server/BlktapController.py
--- a/tools/python/xen/xend/server/BlktapController.py  Mon Jun 28 17:40:16 
2010 +0100
+++ b/tools/python/xen/xend/server/BlktapController.py  Tue Jun 29 15:36:20 
2010 +0900
@@ -222,7 +222,6 @@ class TapdiskController(object):
                 % (self.image, self.pid, self.minor, self.state, self.dtype,
                    self.device)
 
-    @staticmethod
     def exc(*args):
         rc, stdout, stderr = doexec([TapdiskController.TAP_CTL] + list(args))
         out, err = stdout.read().strip(), stderr.read().strip()
@@ -232,8 +231,8 @@ class TapdiskController(object):
             raise TapdiskException('%s failed (%s %s %s)' % \
                                        (args, rc, out, err))
         return out
+    exc = staticmethod(exc)
 
-    @staticmethod
     def check():
         try:
             TapdiskController.exc('check')
@@ -241,8 +240,8 @@ class TapdiskController(object):
         except Exception, e:
             log.warn("tapdisk2 check failed: %s" % e)
             return -1
+    check = staticmethod(check)
 
-    @staticmethod
     def list():
         tapdisks = []
 
@@ -269,8 +268,8 @@ class TapdiskController(object):
             tapdisks.append(tapdisk)
 
         return tapdisks
+    list = staticmethod(list)
 
-    @staticmethod
     def fromDevice(device):
         if device.startswith(TapdiskController.TAP_DEV):
             minor = os.minor(os.stat(device).st_rdev)
@@ -279,12 +278,12 @@ class TapdiskController(object):
             if len(tapdisks) == 1:
                 return tapdisks[0]
         return None
+    fromDevice = staticmethod(fromDevice)
 
-    @staticmethod
     def create(dtype, image):
         return TapdiskController.exc('create', '-a%s:%s' % (dtype, image))
+    create = staticmethod(create)
 
-    @staticmethod
     def destroy(device):
         tapdisk = TapdiskController.fromDevice(device)
         if tapdisk:
@@ -294,19 +293,20 @@ class TapdiskController(object):
                                       '-m%s' % tapdisk.minor)
             else:
                 TapdiskController.exc('free', '-m%s' % tapdisk.minor)
+    destroy = staticmethod(destroy)
 
-    @staticmethod
     def pause(device):
         tapdisk = TapdiskController.fromDevice(device)
         if tapdisk and tapdisk.pid:
             TapdiskController.exc('pause',
                                   '-p%s' % tapdisk.pid,
                                   '-m%s' % tapdisk.minor)
+    pause = staticmethod(pause)
 
-    @staticmethod
     def unpause(device):
         tapdisk = TapdiskController.fromDevice(device)
         if tapdisk and tapdisk.pid:
             TapdiskController.exc('unpause',
                                   '-p%s' % tapdisk.pid,
                                   '-m%s' % tapdisk.minor)
+    unpause = staticmethod(unpause)
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] blktap2: Remove function decorators for Python 2.3, KUWAMURA Shin'ya <=