From 7bbffaed925f70429c3d9fc2fff8f5d4082e3900 Mon Sep 17 00:00:00 2001 From: Ben Kurtovic Date: Thu, 21 Jul 2011 17:56:06 -0400 Subject: [PATCH] cleaning up existing task skeletons and making task_name class-wide instead of instance-wide --- wiki/tasks/afc_catdelink.py | 10 ++++++---- wiki/tasks/afc_copyvios.py | 10 ++++++---- wiki/tasks/afc_dailycats.py | 9 +++++---- wiki/tasks/afc_statistics.py | 15 +++++++-------- wiki/tasks/afc_undated.py | 9 +++++---- wiki/tasks/blptag.py | 10 ++++++---- wiki/tasks/feed_dailycats.py | 9 +++++---- wiki/tasks/wrongmime.py | 10 ++++++---- 8 files changed, 46 insertions(+), 36 deletions(-) diff --git a/wiki/tasks/afc_catdelink.py b/wiki/tasks/afc_catdelink.py index 3f32f5d..5ad71fd 100644 --- a/wiki/tasks/afc_catdelink.py +++ b/wiki/tasks/afc_catdelink.py @@ -1,12 +1,14 @@ # -*- coding: utf-8 -*- -# A task to delink mainspace categories in declined [[WP:AFC]] submissions. - from wiki.base_task import BaseTask class Task(BaseTask): + """A task to delink mainspace categories in declined [[WP:AFC]] + submissions.""" + task_name = "afc_catdelink" + def __init__(self): - self.task_name = "afc_catdelink" - + pass + def run(self, **kwargs): pass diff --git a/wiki/tasks/afc_copyvios.py b/wiki/tasks/afc_copyvios.py index 3669138..93153df 100644 --- a/wiki/tasks/afc_copyvios.py +++ b/wiki/tasks/afc_copyvios.py @@ -1,12 +1,14 @@ # -*- coding: utf-8 -*- -# A task to check newly-edited [[WP:AFC]] submissions for copyright violations. - from wiki.base_task import BaseTask class Task(BaseTask): + """A task to check newly-edited [[WP:AFC]] submissions for copyright + violations.""" + task_name = "afc_copyvios" + def __init__(self): - self.task_name = "afc_copyvios" - + pass + def run(self, **kwargs): pass diff --git a/wiki/tasks/afc_dailycats.py b/wiki/tasks/afc_dailycats.py index 481ba67..2a7c2d9 100644 --- a/wiki/tasks/afc_dailycats.py +++ b/wiki/tasks/afc_dailycats.py @@ -1,12 +1,13 @@ # -*- coding: utf-8 -*- -# A task to create daily categories for [[WP:AFC]]. - from wiki.base_task import BaseTask class Task(BaseTask): + """ A task to create daily categories for [[WP:AFC]].""" + task_name = "afc_dailycats" + def __init__(self): - self.task_name = "afc_dailycats" - + pass + def run(self, **kwargs): pass diff --git a/wiki/tasks/afc_statistics.py b/wiki/tasks/afc_statistics.py index b2cd6fe..967c296 100644 --- a/wiki/tasks/afc_statistics.py +++ b/wiki/tasks/afc_statistics.py @@ -1,15 +1,14 @@ # -*- coding: utf-8 -*- -# A task to generate statistics for [[WP:AFC]] and save them to [[Template:AFC_statistics]]. - -import time - from wiki.base_task import BaseTask class Task(BaseTask): + """A task to generate statistics for [[WP:AFC]] and save them to + [[Template:AFC_statistics]].""" + task_name = "afc_statistics" + def __init__(self): - self.task_name = "afc_statistics" - + pass + def run(self, **kwargs): - time.sleep(10) - print "kwargs: {}".format(kwargs) + pass diff --git a/wiki/tasks/afc_undated.py b/wiki/tasks/afc_undated.py index f8e175c..ad6124a 100644 --- a/wiki/tasks/afc_undated.py +++ b/wiki/tasks/afc_undated.py @@ -1,12 +1,13 @@ # -*- coding: utf-8 -*- -# A task to clear [[Category:Undated AfC submissions]]. - from wiki.base_task import BaseTask class Task(BaseTask): + """A task to clear [[Category:Undated AfC submissions]].""" + task_name = "afc_undated" + def __init__(self): - self.task_name = "afc_undated" - + pass + def run(self, **kwargs): pass diff --git a/wiki/tasks/blptag.py b/wiki/tasks/blptag.py index cdb3800..916c79b 100644 --- a/wiki/tasks/blptag.py +++ b/wiki/tasks/blptag.py @@ -1,12 +1,14 @@ # -*- coding: utf-8 -*- -# A task to add |blp=yes to {{WPB}} or {{WPBS}} when it is used along with {{WP Biography}}. - from wiki.base_task import BaseTask class Task(BaseTask): + """A task to add |blp=yes to {{WPB}} or {{WPBS}} when it is used along with + {{WP Biography}}.""" + task_name = "blptag" + def __init__(self): - self.task_name = "blptag" - + pass + def run(self, **kwargs): pass diff --git a/wiki/tasks/feed_dailycats.py b/wiki/tasks/feed_dailycats.py index d57aac8..6d3cb40 100644 --- a/wiki/tasks/feed_dailycats.py +++ b/wiki/tasks/feed_dailycats.py @@ -1,12 +1,13 @@ # -*- coding: utf-8 -*- -# A task to create daily categories for [[WP:FEED]]. - from wiki.base_task import BaseTask class Task(BaseTask): + """A task to create daily categories for [[WP:FEED]].""" + task_name = "feed_dailycats" + def __init__(self): - self.task_name = "feed_dailycats" - + pass + def run(self, **kwargs): pass diff --git a/wiki/tasks/wrongmime.py b/wiki/tasks/wrongmime.py index ed00c1c..aa56228 100644 --- a/wiki/tasks/wrongmime.py +++ b/wiki/tasks/wrongmime.py @@ -1,12 +1,14 @@ # -*- coding: utf-8 -*- -# A task to tag files whose extensions do not agree with their MIME type. - from wiki.base_task import BaseTask class Task(BaseTask): + """A task to tag files whose extensions do not agree with their MIME + type.""" + task_name = "wrongmime" + def __init__(self): - self.task_name = "wrongmime" - + pass + def run(self, **kwargs): pass