[PATCH v2 2/6] parser: Trivial rename of functions

Stephen Finucane stephen at that.guru
Thu Dec 1 05:42:43 AEDT 2016


'auto_delegate' doesn't actually delegate the patches - it merely finds
a suitable delegate based on the filename. Rename the function
accordingly.

'find_delegate' is also renamed to prevent confusion.

Signed-off-by: Stephen Finucane <stephen at that.guru>
Cc: Paul Jakma <paul at jakma.org>
Cc: Tom Rini <trini at konsulko.com>
---
 patchwork/parser.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/patchwork/parser.py b/patchwork/parser.py
index 2df9278..9d1b79e 100644
--- a/patchwork/parser.py
+++ b/patchwork/parser.py
@@ -688,7 +688,7 @@ def find_state(mail):
     return get_default_initial_patch_state()
 
 
-def auto_delegate(project, filenames):
+def find_delegate_by_filename(project, filenames):
     if not filenames:
         return None
 
@@ -714,7 +714,7 @@ def auto_delegate(project, filenames):
     return patch_delegate
 
 
-def find_delegate(mail):
+def find_delegate_by_header(mail):
     """Return the delegate with the given email or None."""
     delegate_email = mail.get('X-Patchwork-Delegate', '').strip()
     if delegate_email:
@@ -784,10 +784,10 @@ def parse_mail(mail, list_id=None):
         # we delay the saving until we know we have a patch.
         author.save()
 
-        delegate = find_delegate(mail)
+        delegate = find_delegate_by_header(mail)
         if not delegate and diff:
             filenames = find_filenames(diff)
-            delegate = auto_delegate(project, filenames)
+            delegate = find_delegate_by_filename(project, filenames)
 
         series = find_series(mail)
         # We will create a new series if:
-- 
2.9.3



More information about the Patchwork mailing list