]> git.llucax.com Git - software/pymin.git/commitdiff
Make procman.ProcessInfo.name a read-only property.
authorLeandro Lucarella <llucax@gmail.com>
Mon, 19 May 2008 02:17:28 +0000 (23:17 -0300)
committerLeandro Lucarella <llucax@gmail.com>
Wed, 21 May 2008 16:01:57 +0000 (13:01 -0300)
pymin/procman.py

index 2955863e9762a8e22d33347748324ce0f306ba0a..db07628d4ed3dc393b8e01440521a91f677dc2d2 100644 (file)
@@ -12,7 +12,7 @@ __all__ = ('ProcessManager', 'manager', 'register', 'unregister', 'once',
 class ProcessInfo:
     def __init__(self, name, command, callback=None, persist=False,
                  max_errors=3, args=None, kwargs=None):
-        self.name = name
+        self._name = name
         self.command = command
         self.callback = callback
         if args is None: args = list()
@@ -52,6 +52,9 @@ class ProcessInfo:
     @property
     def running(self):
         return self.process is not None and self.process.poll() is None
+    @property
+    def name(self):
+        return self._name
     def __repr__(self):
         pid = None
         if self.process is not None: