Commits

Doug Latornell committed c36880b

PEP 8 cleanup; whitespace and long lines.

Comments (0)

Files changed (1)

master/buildbot/schedulers/trysched.py

 
 class Try_Jobdir(TryBase):
 
-    compare_attrs = TryBase.compare_attrs + ( 'jobdir', )
+    compare_attrs = TryBase.compare_attrs + ('jobdir',)
 
     def __init__(self, name, builderNames, jobdir,
                  properties={}):
-        TryBase.__init__(self, name=name, builderNames=builderNames, properties=properties)
+        TryBase.__init__(self, name=name, builderNames=builderNames,
+                         properties=properties)
         self.jobdir = jobdir
         self.watcher = JobdirService()
         self.watcher.setServiceParent(self)
             if baserev == "":
                 baserev = None
             patchlevel = int(patchlevel)
-            repository=''
-            project=''
-            who=''
-            comment=''
-        elif ver == "2": # introduced the repository and project property
-            buildsetID, branch, baserev, patchlevel, diff, repository, project = p.strings[:7]
+            repository = ''
+            project = ''
+            who = ''
+            comment = ''
+        elif ver == "2":  # introduced the repository and project property
+            (buildsetID, branch, baserev, patchlevel, diff, repository,
+             project) = p.strings[:7]
             builderNames = p.strings[7:]
             if branch == "":
                 branch = None
             if baserev == "":
                 baserev = None
             patchlevel = int(patchlevel)
-            who=''
-            comment=''
-        elif ver == "3": # introduced who property
-            buildsetID, branch, baserev, patchlevel, diff, repository, project, who = p.strings[:8]
+            who = ''
+            comment = ''
+        elif ver == "3":  # introduced who property
+            (buildsetID, branch, baserev, patchlevel, diff, repository,
+             project, who) = p.strings[:8]
             builderNames = p.strings[8:]
             if branch == "":
                 branch = None
             if baserev == "":
                 baserev = None
             patchlevel = int(patchlevel)
-            comment=''
-        elif ver == "4": # introduced try comments
-            buildsetID, branch, baserev, patchlevel, diff, repository, project, who, comment = p.strings[:9]
+            comment = ''
+        elif ver == "4":  # introduced try comments
+            (buildsetID, branch, baserev, patchlevel, diff, repository,
+             project, who, comment) = p.strings[:9]
             builderNames = p.strings[9:]
             if branch == "":
                 branch = None
             if baserev == "":
                 baserev = None
             patchlevel = int(patchlevel)
-            
+
         else:
             raise BadJobfile("unknown version '%s'" % ver)
         return dict(
         # Validate/fixup the builder names.
         builderNames = self.filterBuilderList(builderNames)
         if not builderNames:
-            log.msg("incoming Try job did not specify any allowed builder names")
+            log.msg(
+                "incoming Try job did not specify any allowed builder names")
             return defer.succeed(None)
-        
+
         who = ""
         if parsed_job['who']:
             who = parsed_job['who']
-        
+
         comment = ""
         if parsed_job['comment']:
             comment = parsed_job['comment']
                 patch_level=parsed_job['patch_level'],
                 patch_author=who,
                 patch_comment=comment,
-                patch_subdir='', # TODO: can't set this remotely - #1769
+                patch_subdir='',  # TODO: can't set this remotely - #1769
                 project=parsed_job['project'],
                 repository=parsed_job['repository'])
             return setid
 
         d.addCallback(addsourcestamp)
+
         def create_buildset(setid):
             reason = "'try' job"
             if parsed_job['who']:
 
     @defer.inlineCallbacks
     def perspective_try(self, branch, revision, patch, repository, project,
-                        builderNames, who="", comment="", properties={} ):
+                        builderNames, who="", comment="", properties={}):
         db = self.scheduler.master.db
         log.msg("user %s requesting build on builders %s" % (self.username,
                                                              builderNames))
             return
 
         reason = "'try' job"
-        
+
         if who:
             reason += " by user %s" % who
-            
+
         if comment:
             reason += " (%s)" % comment
 
         sourcestampsetid = yield db.sourcestampsets.addSourceStampSet()
 
-        yield db.sourcestamps.addSourceStamp(branch=branch, revision=revision,
-                    repository=repository, project=project, patch_level=patch[0],
-                    patch_body=patch[1], patch_subdir='', patch_author=who or '',
-                    patch_comment=comment or '', sourcestampsetid = sourcestampsetid)
+        yield db.sourcestamps.addSourceStamp(
+            branch=branch, revision=revision, repository=repository,
+            project=project, patch_level=patch[0], patch_body=patch[1],
+            patch_subdir='', patch_author=who or '',
+            patch_comment=comment or '',
+            sourcestampsetid=sourcestampsetid)
                     # note: no way to specify patch subdir - #1769
 
         requested_props = Properties()
 
 
 class Try_Userpass(TryBase):
-    compare_attrs = ( 'name', 'builderNames', 'port', 'userpass', 'properties' )
+    compare_attrs = ('name', 'builderNames', 'port', 'userpass', 'properties')
 
     def __init__(self, name, builderNames, port, userpass,
                  properties={}):
-        TryBase.__init__(self, name=name, builderNames=builderNames, properties=properties)
+        TryBase.__init__(self, name=name, builderNames=builderNames,
+                         properties=properties)
         self.port = port
         self.userpass = userpass
 
         self.registrations = []
         for user, passwd in self.userpass:
             self.registrations.append(
-                    self.master.pbmanager.register(self.port, user, passwd, factory))
+                self.master.pbmanager.register(
+                    self.port, user, passwd, factory))
 
     def stopService(self):
         d = defer.maybeDeferred(TryBase.stopService, self)
+
         def unreg(_):
             return defer.gatherResults(
-                [ reg.unregister() for reg in self.registrations ])
+                [reg.unregister() for reg in self.registrations])
         d.addCallback(unreg)
         return d