Commits

Olemis Lang committed 2df3bbf

Trac #11148 : method '_get_prefixed_method_name' can be completely removed now (see trac:comment:14ticket11148 by andrej)

Comments (0)

Files changed (1)

t11148/t11148_r11782_IEntityChangeListener_extends_with_prefix.diff

 
 diff -r 8d0c3223a818 trac/core.py
 --- a/trac/core.py	Thu Apr 18 14:30:21 2013 +0000
-+++ b/trac/core.py	Fri Apr 19 00:27:22 2013 -0500
++++ b/trac/core.py	Mon Apr 22 10:52:53 2013 -0500
 @@ -165,8 +165,30 @@
  
          locals_.setdefault('_implements', []).extend(interfaces)
  
  
  class ComponentManager(object):
-@@ -236,3 +258,82 @@
+@@ -236,3 +258,63 @@
          with the given class will not be available.
          """
          return True
 +        #TBD: we can also call listeners implemented IEntityChangeListener here
 +        #if community will agree that generic event listeners support is needed
 +
-+    def _get_prefixed_method_name(self, method_name, prefix):
-+        """
-+        Replaces the first method name part with prefix. For example,
-+        for method_name "entity_created" and prefix "xxx" return
-+        "xxx_created",
-+        for input method_name "created" and prefix "xxx" return
-+        "xxx_created",
-+        """
-+        method_parts = method_name.split(self.METHOD_DELIMITER)
-+        if len(method_parts) == 1:
-+            #method name contains only one part, just add prefix before
-+            # the method name
-+            prefixed_method = self.METHOD_DELIMITER.join((prefix, method_name))
-+        else:
-+            #replace the first part of the method name with prefix
-+            method_parts[0] = prefix
-+            prefixed_method = self.METHOD_DELIMITER.join(method_parts)
-+        return prefixed_method
-+
 diff -r 8d0c3223a818 trac/ticket/model.py
 --- a/trac/ticket/model.py	Thu Apr 18 14:30:21 2013 +0000
-+++ b/trac/ticket/model.py	Fri Apr 19 00:27:22 2013 -0500
++++ b/trac/ticket/model.py	Mon Apr 22 10:52:53 2013 -0500
 @@ -25,7 +25,8 @@
  from trac.attachment import Attachment
  from trac import core
          """
 diff -r 8d0c3223a818 trac/ticket/tests/model.py
 --- a/trac/ticket/tests/model.py	Thu Apr 18 14:30:21 2013 +0000
-+++ b/trac/ticket/tests/model.py	Fri Apr 19 00:27:22 2013 -0500
++++ b/trac/ticket/tests/model.py	Mon Apr 22 10:52:53 2013 -0500
 @@ -12,8 +12,8 @@
  from trac.core import TracError, implements
  from trac.resource import ResourceNotFound