[kteam-tools 0/5] [link-to-tracker] Pylint and PEP8 cleanups

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[kteam-tools 0/5] [link-to-tracker] Pylint and PEP8 cleanups

Juerg Haefliger
A slew of patches that fix various pylint and PEP8 reported issues.
Just because I like squicky clean code.

These are non-functional changes.

A branch with the changes is here:
https://git.launchpad.net/~juergh/+git/kteam-tools/log/?h=review/master

Juerg Haefliger (5):
  [link-to-tracker] Cleanups: replace variable 's' with 'self'
  [link-to-tracker] Cleanups: fix whitespace issues
  [link-to-tracker] Cleanups: fix setattr() issues
  [link-to-tracker] Cleanups: additional fixes to please pylint
  [link-to-tracker] PEP8 cleanups

 stable/link-to-tracker | 131 +++++++++++++++++++++++++------------------------
 1 file changed, 68 insertions(+), 63 deletions(-)

--
2.11.0


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[kteam-tools 1/5] [link-to-tracker] Cleanups: replace variable 's' with 'self'

Juerg Haefliger
Non-functional changes to fix the following pylint issues:
  - Method should have "self" as first argument (no-self-argument)
  - Invalid argument name "s" (invalid-name)

Signed-off-by: Juerg Haefliger <[hidden email]>
---
 stable/link-to-tracker | 78 +++++++++++++++++++++++++-------------------------
 1 file changed, 39 insertions(+), 39 deletions(-)

diff --git a/stable/link-to-tracker b/stable/link-to-tracker
index d3d84a4b867b..780c252d4827 100755
--- a/stable/link-to-tracker
+++ b/stable/link-to-tracker
@@ -28,46 +28,46 @@ class WorkflowBugTask(object):
 
     # __init__
     #
-    def __init__(s, lp_task, task_name):
-        s.__status   = None
-        s.__assignee = None
-        setattr(s, 'name', task_name)
-        setattr(s, 'importance', lp_task.importance)
-        setattr(s, 'lp_task', lp_task)
-        s.__modified = False
-        s.bug = lp_task.bug
+    def __init__(self, lp_task, task_name):
+        self.__status   = None
+        self.__assignee = None
+        setattr(self, 'name', task_name)
+        setattr(self, 'importance', lp_task.importance)
+        setattr(self, 'lp_task', lp_task)
+        self.__modified = False
+        self.bug = lp_task.bug
 
     # status
     #
     @property
-    def status(s):
+    def status(self):
         '''
         Property: Gets the status for the task.
         '''
-        if s.__status is None:
-            s.__status = s.lp_task.status
-        return s.__status
+        if self.__status is None:
+            self.__status = self.lp_task.status
+        return self.__status
 
     # assignee
     #
     @property
-    def assignee(s):
+    def assignee(self):
         '''
         Property: Gets the assignee for the task.
         '''
-        if s.__assignee is None:
-            assignee = s.lp_task.assignee
+        if self.__assignee is None:
+            assignee = self.lp_task.assignee
             if assignee is None:
-                s.__assignee = '*Unassigned'
+                self.__assignee = '*Unassigned'
             else:
-                s.__assignee = assignee.display_name
-        return s.__assignee
+                self.__assignee = assignee.display_name
+        return self.__assignee
 
     # modified
     #
     @property
-    def modified(s):
-        return s.__modified
+    def modified(self):
+        return self.__modified
 
 # Tracking
 #
@@ -76,16 +76,16 @@ class Tracking():
     '''
     # __init__
     #
-    def __init__(s, args):
-        s.args = args
-        s.launchpad = Launchpad('start-sru-cycle').service
-        s.project_tracked = 'kernel-sru-workflow'
+    def __init__(self, args):
+        self.args = args
+        self.launchpad = Launchpad('start-sru-cycle').service
+        self.project_tracked = 'kernel-sru-workflow'
 
-    def trackers(s, project):
+    def trackers(self, project):
         '''
         Return a list of all the tracking bugs that need to be processed.
         '''
-        center(s.__class__.__name__ + '.trackers')
+        center(self.__class__.__name__ + '.trackers')
 
         retval = {}
 
@@ -98,7 +98,7 @@ class Tracking():
         # The tracking bugs that we are interested in should have been created recently (days).
         #
         search_since           = datetime.utcnow() - timedelta(days=30)
-        lp_project = s.launchpad.projects[project]
+        lp_project = self.launchpad.projects[project]
         tasks = lp_project.searchTasks(status=search_status, tags=search_tags, tags_combinator=search_tags_combinator, modified_since=search_since)
 
         for task in tasks:
@@ -106,11 +106,11 @@ class Tracking():
             cdebug('    LP: #%s - %s' % (bug.id, bug.title))
             retval[bug.id] = bug.title
 
-        cleave(s.__class__.__name__ + '.trackers')
+        cleave(self.__class__.__name__ + '.trackers')
         return retval
 
     @property
-    def repo_info(s):
+    def repo_info(self):
         # Check: Are we currently in a git repository?
         #
         if not Git.is_repo():
@@ -125,35 +125,35 @@ class Tracking():
 
     # create_tasks_by_name_mapping
     #
-    def create_tasks_by_name_mapping(s, bugid, project):
+    def create_tasks_by_name_mapping(self, bugid, project):
         '''
         We are only interested in the tasks that are specific to the workflow project. Others
         are ignored.
         '''
-        center(s.__class__.__name__ + '.create_tasks_by_name_mapping')
+        center(self.__class__.__name__ + '.create_tasks_by_name_mapping')
         tasks_by_name = {}
 
         cdebug('    Scanning bug tasks:', 'cyan')
 
-        lpbug = s.launchpad.bugs[bugid]
+        lpbug = self.launchpad.bugs[bugid]
         for task in lpbug.bug_tasks:
             task_name       = task.bug_target_name
             # task_name       = task.bug_target_name.replace(project, '').replace('/', '').split(' ', 1)[0]
             task_name       = task.bug_target_name.replace(project, '').replace('/', '')
             tasks_by_name[task_name] = WorkflowBugTask(task, task_name)
 
-        cleave(s.__class__.__name__ + '.create_tasks_by_name_mapping')
+        cleave(self.__class__.__name__ + '.create_tasks_by_name_mapping')
         return tasks_by_name
 
     # main
     #
-    def main(s):
+    def main(self):
         retval = 1
         try:
-            target_package, target_series = s.repo_info
+            target_package, target_series = self.repo_info
             found = False
-            for bugid in s.trackers(s.project_tracked):
-                tasks_by_name = s.create_tasks_by_name_mapping(bugid, s.project_tracked)
+            for bugid in self.trackers(self.project_tracked):
+                tasks_by_name = self.create_tasks_by_name_mapping(bugid, self.project_tracked)
                 if '%s (Ubuntu %s)' % (target_package, target_series.title()) in tasks_by_name:
                     found = True
                     break
@@ -181,13 +181,13 @@ class Tracking():
                     f.write(line)
             retval = 0
 
-            lpbug = s.launchpad.bugs[bugid]
+            lpbug = self.launchpad.bugs[bugid]
             lpbug.title = title
             lpbug.lp_save()
 
             task = tasks_by_name['prepare-package'].lp_task
             task.status = "In Progress"
-            task.assignee = s.launchpad.me
+            task.assignee = self.launchpad.me
             task.lp_save()
 
         # Handle the user presses <ctrl-C>.
--
2.11.0


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[kteam-tools 2/5] [link-to-tracker] Cleanups: fix whitespace issues

Juerg Haefliger
In reply to this post by Juerg Haefliger
Non-functional changes to fix the following pylint issues:
  - Exactly one space required before assignment
  - Exactly one space required after comma

Signed-off-by: Juerg Haefliger <[hidden email]>
---
 stable/link-to-tracker | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/stable/link-to-tracker b/stable/link-to-tracker
index 780c252d4827..d76b82b3f56d 100755
--- a/stable/link-to-tracker
+++ b/stable/link-to-tracker
@@ -23,13 +23,13 @@ class AppError(Exception):
 #
 class WorkflowBugTask(object):
     dryrun = False
-    no_assignments    = False
+    no_assignments = False
     no_status_changes = False
 
     # __init__
     #
     def __init__(self, lp_task, task_name):
-        self.__status   = None
+        self.__status = None
         self.__assignee = None
         setattr(self, 'name', task_name)
         setattr(self, 'importance', lp_task.importance)
@@ -90,14 +90,14 @@ class Tracking():
         retval = {}
 
         cdebug('project: %s' % project)
-        search_tags            = []
+        search_tags = []
         search_tags_combinator = "All"
         # A list of the bug statuses that we care about
         #
-        search_status          = ["New", "In Progress", "Incomplete", "Fix Committed"]
+        search_status = ["New", "In Progress", "Incomplete", "Fix Committed"]
         # The tracking bugs that we are interested in should have been created recently (days).
         #
-        search_since           = datetime.utcnow() - timedelta(days=30)
+        search_since = datetime.utcnow() - timedelta(days=30)
         lp_project = self.launchpad.projects[project]
         tasks = lp_project.searchTasks(status=search_status, tags=search_tags, tags_combinator=search_tags_combinator, modified_since=search_since)
 
@@ -121,7 +121,7 @@ class Tracking():
         if changelog[0]['series'] == 'UNRELEASED':
             raise AppError('You must set the changelog series to something other than UNRELEASED.')
 
-        return changelog[0]['package'],  changelog[0]['series']
+        return changelog[0]['package'], changelog[0]['series']
 
     # create_tasks_by_name_mapping
     #
@@ -137,9 +137,9 @@ class Tracking():
 
         lpbug = self.launchpad.bugs[bugid]
         for task in lpbug.bug_tasks:
-            task_name       = task.bug_target_name
-            # task_name       = task.bug_target_name.replace(project, '').replace('/', '').split(' ', 1)[0]
-            task_name       = task.bug_target_name.replace(project, '').replace('/', '')
+            task_name = task.bug_target_name
+            # task_name = task.bug_target_name.replace(project, '').replace('/', '').split(' ', 1)[0]
+            task_name = task.bug_target_name.replace(project, '').replace('/', '')
             tasks_by_name[task_name] = WorkflowBugTask(task, task_name)
 
         cleave(self.__class__.__name__ + '.create_tasks_by_name_mapping')
@@ -159,7 +159,7 @@ class Tracking():
                     break
 
             if found == False:
-                raise AppError('Cannot find tracker bug matching package %s series %s' % (target_package,target_series))
+                raise AppError('Cannot find tracker bug matching package %s series %s' % (target_package, target_series))
                 exit(retval)
             # -------------------------------------------------------------------------------------
             # C H A N G E L O G   W O R K
@@ -210,7 +210,7 @@ if __name__ == '__main__':
     '''
 
     parser = ArgumentParser(description=app_description, epilog=app_epilog, formatter_class=RawDescriptionHelpFormatter)
-    parser.add_argument('--info',  action='store_true', default=False, help='')
+    parser.add_argument('--info', action='store_true', default=False, help='')
     parser.add_argument('--debug', action='store_true', default=False, help='')
     args = parser.parse_args()
 
--
2.11.0


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[kteam-tools 3/5] [link-to-tracker] Cleanups: fix setattr() issues

Juerg Haefliger
In reply to this post by Juerg Haefliger
Non-functional changes to fix the following pylint issues:
  - Instance of 'WorkflowBugTask' has no <foo> member (no-member)

Signed-off-by: Juerg Haefliger <[hidden email]>
---
 stable/link-to-tracker | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/stable/link-to-tracker b/stable/link-to-tracker
index d76b82b3f56d..d784268e0dfa 100755
--- a/stable/link-to-tracker
+++ b/stable/link-to-tracker
@@ -31,10 +31,10 @@ class WorkflowBugTask(object):
     def __init__(self, lp_task, task_name):
         self.__status = None
         self.__assignee = None
-        setattr(self, 'name', task_name)
-        setattr(self, 'importance', lp_task.importance)
-        setattr(self, 'lp_task', lp_task)
         self.__modified = False
+        self.name = task_name
+        self.importance = lp_task.importance
+        self.lp_task = lp_task
         self.bug = lp_task.bug
 
     # status
--
2.11.0


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[kteam-tools 4/5] [link-to-tracker] Cleanups: additional fixes to please pylint

Juerg Haefliger
In reply to this post by Juerg Haefliger
Non-functional changes to fix the following pylint issues:
  - Old-style class defined. (old-style-class)
  - Redefining name 'args' from outer scope (redefined-outer-name)
  - Comparison to False should be 'not expr' or 'expr is False' (singleton-comparison)
  - Unreachable code (unreachable)
  - Using possibly undefined loop variable 'bugid' (undefined-loop-variable)
  - Unused cinfo imported from ktl.log (unused-import)

Signed-off-by: Juerg Haefliger <[hidden email]>
---
 stable/link-to-tracker | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

diff --git a/stable/link-to-tracker b/stable/link-to-tracker
index d784268e0dfa..63f6b3fe9b8f 100755
--- a/stable/link-to-tracker
+++ b/stable/link-to-tracker
@@ -4,7 +4,7 @@
 from datetime                           import datetime, timedelta
 from argparse                           import ArgumentParser, RawDescriptionHelpFormatter
 from logging                            import basicConfig, DEBUG, INFO, WARNING
-from ktl.log                            import center, cleave, cdebug, cinfo, Clog
+from ktl.log                            import center, cleave, cdebug, Clog
 from ktl.launchpad                      import Launchpad
 from ktl3.git                           import Git
 from ktl3.debian                        import Debian
@@ -71,7 +71,7 @@ class WorkflowBugTask(object):
 
 # Tracking
 #
-class Tracking():
+class Tracking(object):
     '''
     '''
     # __init__
@@ -151,6 +151,7 @@ class Tracking():
         retval = 1
         try:
             target_package, target_series = self.repo_info
+            bugid = 0
             found = False
             for bugid in self.trackers(self.project_tracked):
                 tasks_by_name = self.create_tasks_by_name_mapping(bugid, self.project_tracked)
@@ -158,9 +159,9 @@ class Tracking():
                     found = True
                     break
 
-            if found == False:
+            if not found:
                 raise AppError('Cannot find tracker bug matching package %s series %s' % (target_package, target_series))
-                exit(retval)
+
             # -------------------------------------------------------------------------------------
             # C H A N G E L O G   W O R K
 
@@ -212,23 +213,23 @@ if __name__ == '__main__':
     parser = ArgumentParser(description=app_description, epilog=app_epilog, formatter_class=RawDescriptionHelpFormatter)
     parser.add_argument('--info', action='store_true', default=False, help='')
     parser.add_argument('--debug', action='store_true', default=False, help='')
-    args = parser.parse_args()
+    pargs = parser.parse_args()
 
     # If logging parameters were set on the command line, handle them
     # here.
     #
     Clog.color = True
-    if args.debug:
+    if pargs.debug:
         log_format = "%(levelname)s - %(message)s"
         basicConfig(level=DEBUG, format=log_format)
         Clog.dbg = True
-    elif args.info:
+    elif pargs.info:
         log_format = "%(message)s"
         basicConfig(level=INFO, format=log_format)
     else:
         log_format = "%(message)s"
         basicConfig(level=WARNING, format=log_format)
 
-    exit(Tracking(args).main())
+    exit(Tracking(pargs).main())
 
 # vi:set ts=4 sw=4 expandtab syntax=python:
--
2.11.0


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[kteam-tools 5/5] [link-to-tracker] PEP8 cleanups

Juerg Haefliger
In reply to this post by Juerg Haefliger
Non-functional changes to fix the following PEP8 issues:
  - E272 multiple spaces before keyword
  - E302 expected 2 blank lines, found 1

Signed-off-by: Juerg Haefliger <[hidden email]>
---
 stable/link-to-tracker | 18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)

diff --git a/stable/link-to-tracker b/stable/link-to-tracker
index 63f6b3fe9b8f..356c017c5017 100755
--- a/stable/link-to-tracker
+++ b/stable/link-to-tracker
@@ -1,13 +1,14 @@
 #!/usr/bin/env python3
 #
 
-from datetime                           import datetime, timedelta
-from argparse                           import ArgumentParser, RawDescriptionHelpFormatter
-from logging                            import basicConfig, DEBUG, INFO, WARNING
-from ktl.log                            import center, cleave, cdebug, Clog
-from ktl.launchpad                      import Launchpad
-from ktl3.git                           import Git
-from ktl3.debian                        import Debian
+from datetime import datetime, timedelta
+from argparse import ArgumentParser, RawDescriptionHelpFormatter
+from logging import basicConfig, DEBUG, INFO, WARNING
+from ktl.log import center, cleave, cdebug, Clog
+from ktl.launchpad import Launchpad
+from ktl3.git import Git
+from ktl3.debian import Debian
+
 
 # AppError
 #
@@ -19,6 +20,7 @@ class AppError(Exception):
     def __init__(self, error=''):
         self.msg = error
 
+
 # WorkflowBugTask
 #
 class WorkflowBugTask(object):
@@ -69,6 +71,7 @@ class WorkflowBugTask(object):
     def modified(self):
         return self.__modified
 
+
 # Tracking
 #
 class Tracking(object):
@@ -203,6 +206,7 @@ class Tracking(object):
 
         return retval
 
+
 if __name__ == '__main__':
     app_description = '''
     '''
--
2.11.0


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

NAK: [kteam-tools 1/5] [link-to-tracker] Cleanups: replace variable 's' with 'self'

brad.figg
In reply to this post by Juerg Haefliger

's' is used in place of 'self' by all the code I write. If you are going to be making
this change we are going to have a lot of churn in our code.

On Wed, Jun 28, 2017 at 10:46:28AM +0200, Juerg Haefliger wrote:

> Non-functional changes to fix the following pylint issues:
>   - Method should have "self" as first argument (no-self-argument)
>   - Invalid argument name "s" (invalid-name)
>
> Signed-off-by: Juerg Haefliger <[hidden email]>
> ---
>  stable/link-to-tracker | 78 +++++++++++++++++++++++++-------------------------
>  1 file changed, 39 insertions(+), 39 deletions(-)
>
> diff --git a/stable/link-to-tracker b/stable/link-to-tracker
> index d3d84a4b867b..780c252d4827 100755
> --- a/stable/link-to-tracker
> +++ b/stable/link-to-tracker
> @@ -28,46 +28,46 @@ class WorkflowBugTask(object):
>  
>      # __init__
>      #
> -    def __init__(s, lp_task, task_name):
> -        s.__status   = None
> -        s.__assignee = None
> -        setattr(s, 'name', task_name)
> -        setattr(s, 'importance', lp_task.importance)
> -        setattr(s, 'lp_task', lp_task)
> -        s.__modified = False
> -        s.bug = lp_task.bug
> +    def __init__(self, lp_task, task_name):
> +        self.__status   = None
> +        self.__assignee = None
> +        setattr(self, 'name', task_name)
> +        setattr(self, 'importance', lp_task.importance)
> +        setattr(self, 'lp_task', lp_task)
> +        self.__modified = False
> +        self.bug = lp_task.bug
>  
>      # status
>      #
>      @property
> -    def status(s):
> +    def status(self):
>          '''
>          Property: Gets the status for the task.
>          '''
> -        if s.__status is None:
> -            s.__status = s.lp_task.status
> -        return s.__status
> +        if self.__status is None:
> +            self.__status = self.lp_task.status
> +        return self.__status
>  
>      # assignee
>      #
>      @property
> -    def assignee(s):
> +    def assignee(self):
>          '''
>          Property: Gets the assignee for the task.
>          '''
> -        if s.__assignee is None:
> -            assignee = s.lp_task.assignee
> +        if self.__assignee is None:
> +            assignee = self.lp_task.assignee
>              if assignee is None:
> -                s.__assignee = '*Unassigned'
> +                self.__assignee = '*Unassigned'
>              else:
> -                s.__assignee = assignee.display_name
> -        return s.__assignee
> +                self.__assignee = assignee.display_name
> +        return self.__assignee
>  
>      # modified
>      #
>      @property
> -    def modified(s):
> -        return s.__modified
> +    def modified(self):
> +        return self.__modified
>  
>  # Tracking
>  #
> @@ -76,16 +76,16 @@ class Tracking():
>      '''
>      # __init__
>      #
> -    def __init__(s, args):
> -        s.args = args
> -        s.launchpad = Launchpad('start-sru-cycle').service
> -        s.project_tracked = 'kernel-sru-workflow'
> +    def __init__(self, args):
> +        self.args = args
> +        self.launchpad = Launchpad('start-sru-cycle').service
> +        self.project_tracked = 'kernel-sru-workflow'
>  
> -    def trackers(s, project):
> +    def trackers(self, project):
>          '''
>          Return a list of all the tracking bugs that need to be processed.
>          '''
> -        center(s.__class__.__name__ + '.trackers')
> +        center(self.__class__.__name__ + '.trackers')
>  
>          retval = {}
>  
> @@ -98,7 +98,7 @@ class Tracking():
>          # The tracking bugs that we are interested in should have been created recently (days).
>          #
>          search_since           = datetime.utcnow() - timedelta(days=30)
> -        lp_project = s.launchpad.projects[project]
> +        lp_project = self.launchpad.projects[project]
>          tasks = lp_project.searchTasks(status=search_status, tags=search_tags, tags_combinator=search_tags_combinator, modified_since=search_since)
>  
>          for task in tasks:
> @@ -106,11 +106,11 @@ class Tracking():
>              cdebug('    LP: #%s - %s' % (bug.id, bug.title))
>              retval[bug.id] = bug.title
>  
> -        cleave(s.__class__.__name__ + '.trackers')
> +        cleave(self.__class__.__name__ + '.trackers')
>          return retval
>  
>      @property
> -    def repo_info(s):
> +    def repo_info(self):
>          # Check: Are we currently in a git repository?
>          #
>          if not Git.is_repo():
> @@ -125,35 +125,35 @@ class Tracking():
>  
>      # create_tasks_by_name_mapping
>      #
> -    def create_tasks_by_name_mapping(s, bugid, project):
> +    def create_tasks_by_name_mapping(self, bugid, project):
>          '''
>          We are only interested in the tasks that are specific to the workflow project. Others
>          are ignored.
>          '''
> -        center(s.__class__.__name__ + '.create_tasks_by_name_mapping')
> +        center(self.__class__.__name__ + '.create_tasks_by_name_mapping')
>          tasks_by_name = {}
>  
>          cdebug('    Scanning bug tasks:', 'cyan')
>  
> -        lpbug = s.launchpad.bugs[bugid]
> +        lpbug = self.launchpad.bugs[bugid]
>          for task in lpbug.bug_tasks:
>              task_name       = task.bug_target_name
>              # task_name       = task.bug_target_name.replace(project, '').replace('/', '').split(' ', 1)[0]
>              task_name       = task.bug_target_name.replace(project, '').replace('/', '')
>              tasks_by_name[task_name] = WorkflowBugTask(task, task_name)
>  
> -        cleave(s.__class__.__name__ + '.create_tasks_by_name_mapping')
> +        cleave(self.__class__.__name__ + '.create_tasks_by_name_mapping')
>          return tasks_by_name
>  
>      # main
>      #
> -    def main(s):
> +    def main(self):
>          retval = 1
>          try:
> -            target_package, target_series = s.repo_info
> +            target_package, target_series = self.repo_info
>              found = False
> -            for bugid in s.trackers(s.project_tracked):
> -                tasks_by_name = s.create_tasks_by_name_mapping(bugid, s.project_tracked)
> +            for bugid in self.trackers(self.project_tracked):
> +                tasks_by_name = self.create_tasks_by_name_mapping(bugid, self.project_tracked)
>                  if '%s (Ubuntu %s)' % (target_package, target_series.title()) in tasks_by_name:
>                      found = True
>                      break
> @@ -181,13 +181,13 @@ class Tracking():
>                      f.write(line)
>              retval = 0
>  
> -            lpbug = s.launchpad.bugs[bugid]
> +            lpbug = self.launchpad.bugs[bugid]
>              lpbug.title = title
>              lpbug.lp_save()
>  
>              task = tasks_by_name['prepare-package'].lp_task
>              task.status = "In Progress"
> -            task.assignee = s.launchpad.me
> +            task.assignee = self.launchpad.me
>              task.lp_save()
>  
>          # Handle the user presses <ctrl-C>.
> --
> 2.11.0
>
>
> --
> kernel-team mailing list
> [hidden email]
> https://lists.ubuntu.com/mailman/listinfo/kernel-team

--
Brad Figg [hidden email] http://www.canonical.com

--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

NAK: [kteam-tools 0/5] [link-to-tracker] Pylint and PEP8 cleanups

brad.figg
In reply to this post by Juerg Haefliger

I'm not a fan of just a bunch of changes to appease PEP8.

On Wed, Jun 28, 2017 at 10:46:27AM +0200, Juerg Haefliger wrote:

> A slew of patches that fix various pylint and PEP8 reported issues.
> Just because I like squicky clean code.
>
> These are non-functional changes.
>
> A branch with the changes is here:
> https://git.launchpad.net/~juergh/+git/kteam-tools/log/?h=review/master
>
> Juerg Haefliger (5):
>   [link-to-tracker] Cleanups: replace variable 's' with 'self'
>   [link-to-tracker] Cleanups: fix whitespace issues
>   [link-to-tracker] Cleanups: fix setattr() issues
>   [link-to-tracker] Cleanups: additional fixes to please pylint
>   [link-to-tracker] PEP8 cleanups
>
>  stable/link-to-tracker | 131 +++++++++++++++++++++++++------------------------
>  1 file changed, 68 insertions(+), 63 deletions(-)
>
> --
> 2.11.0
>
>
> --
> kernel-team mailing list
> [hidden email]
> https://lists.ubuntu.com/mailman/listinfo/kernel-team

--
Brad Figg [hidden email] http://www.canonical.com

--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Loading...