<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[153421] contrib/buildbot-test/master.cfg</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="https://trac.macports.org/changeset/153421">153421</a></dd>
<dt>Author</dt> <dd>larryv@macports.org</dd>
<dt>Date</dt> <dd>2016-09-29 18:05:42 -0700 (Thu, 29 Sep 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>buildbot: Standardize on PEP 8 quoting

Use single quotes throughout, except for triple-quoted strings and
strings that themselves contain single quotes.

https://www.python.org/dev/peps/pep-0008/#string-quotes</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#contribbuildbottestmastercfg">contrib/buildbot-test/master.cfg</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="contribbuildbottestmastercfg"></a>
<div class="modfile"><h4>Modified: contrib/buildbot-test/master.cfg (153420 => 153421)</h4>
<pre class="diff"><span>
<span class="info">--- contrib/buildbot-test/master.cfg 2016-09-30 00:19:41 UTC (rev 153420)
+++ contrib/buildbot-test/master.cfg    2016-09-30 01:05:42 UTC (rev 153421)
</span><span class="lines">@@ -28,16 +28,16 @@
</span><span class="cx"> 
</span><span class="cx"> config = {
</span><span class="cx">     'production':   False,
</span><del>-    'privkey':      "",
</del><ins>+    'privkey':      '',
</ins><span class="cx">     'slaveport':    9989,
</span><span class="cx">     'httpport':     8010,
</span><del>-    'buildboturl':  "http://localhost:8010/",
-    'htpasswdfile': "htpasswd",
-    'mpbbsvnurl':   "https://svn.macports.org/repository/macports/contrib/mp-buildbot",
-    'svnurl':       "https://svn.macports.org/repository/macports/trunk",
-    'archivesite':  "https://packages.macports.org",
-    'slaveprefix':  "/opt/local",
-    'toolsprefix':  "/opt/mports",
</del><ins>+    'buildboturl':  'http://localhost:8010/',
+    'htpasswdfile': 'htpasswd',
+    'mpbbsvnurl':   'https://svn.macports.org/repository/macports/contrib/mp-buildbot',
+    'svnurl':       'https://svn.macports.org/repository/macports/trunk',
+    'archivesite':  'https://packages.macports.org',
+    'slaveprefix':  '/opt/local',
+    'toolsprefix':  '/opt/mports',
</ins><span class="cx">     'deploy': {}
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -48,8 +48,8 @@
</span><span class="cx">         if configdata[key]:
</span><span class="cx">             config[key] = configdata[key]
</span><span class="cx"> 
</span><del>-path_base  = "/usr/bin:/bin:/usr/sbin:/sbin"
-path_ports = os.path.join(config['toolsprefix'], "bin") + ":" + path_base
</del><ins>+path_base  = '/usr/bin:/bin:/usr/sbin:/sbin'
+path_ports = os.path.join(config['toolsprefix'], 'bin') + ':' + path_base
</ins><span class="cx"> path_docs = path_ports
</span><span class="cx"> 
</span><span class="cx"> # Allow spaces and tabs in property values
</span><span class="lines">@@ -111,11 +111,11 @@
</span><span class="cx"> 
</span><span class="cx"> def change_has_ports(change):
</span><span class="cx">     for f in change.files:
</span><del>-        if "_resources" in f:
</del><ins>+        if '_resources' in f:
</ins><span class="cx">             continue
</span><span class="cx">         # should actually skip changes to files/ only, but only if we know the
</span><span class="cx">         # last build of the port succeeded
</span><del>-        if "dports" in f and ("Portfile" in f or "files" in f):
</del><ins>+        if 'dports' in f and ('Portfile' in f or 'files' in f):
</ins><span class="cx">             return True
</span><span class="cx">     return False
</span><span class="cx"> 
</span><span class="lines">@@ -143,10 +143,10 @@
</span><span class="cx"> wwwfilter = ChangeFilter(filter_fn=change_has_www)
</span><span class="cx"> guidefilter = ChangeFilter(filter_fn=change_has_guide)
</span><span class="cx"> 
</span><del>-base_buildernames = ["base-"+plat for plat in build_platforms if 'legacy' not in plat and '10.6_i386' not in plat]
-portwatcher_buildernames = ["ports-"+plat+"-watcher" for plat in build_platforms if 'linux' not in plat and '10.5_ppc' != plat]
-portbuilder_buildernames = ["ports-"+plat+"-builder" for plat in build_platforms if 'linux' not in plat and '10.5_ppc' != plat]
-portbuilder_triggerables = ["ports-"+plat+"-trigger" for plat in build_platforms if 'linux' not in plat and '10.5_ppc' != plat]
</del><ins>+base_buildernames = ['base-'+plat for plat in build_platforms if 'legacy' not in plat and '10.6_i386' not in plat]
+portwatcher_buildernames = ['ports-'+plat+'-watcher' for plat in build_platforms if 'linux' not in plat and '10.5_ppc' != plat]
+portbuilder_buildernames = ['ports-'+plat+'-builder' for plat in build_platforms if 'linux' not in plat and '10.5_ppc' != plat]
+portbuilder_triggerables = ['ports-'+plat+'-trigger' for plat in build_platforms if 'linux' not in plat and '10.5_ppc' != plat]
</ins><span class="cx"> 
</span><span class="cx"> from buildbot.schedulers.basic import SingleBranchScheduler
</span><span class="cx"> from buildbot.schedulers.forcesched import ForceScheduler
</span><span class="lines">@@ -155,34 +155,34 @@
</span><span class="cx"> 
</span><span class="cx"> c['schedulers'] = [
</span><span class="cx">     SingleBranchScheduler(
</span><del>-        name="base",
</del><ins>+        name='base',
</ins><span class="cx">         treeStableTimer=None,
</span><span class="cx">         change_filter = basefilter,
</span><span class="cx">         builderNames=base_buildernames),
</span><span class="cx">     SingleBranchScheduler(
</span><del>-        name="ports",
</del><ins>+        name='ports',
</ins><span class="cx">         treeStableTimer=None,
</span><span class="cx">         change_filter = portsfilter,
</span><span class="cx">         builderNames=portwatcher_buildernames),
</span><span class="cx">     ForceScheduler(
</span><del>-        name="base_force",
</del><ins>+        name='base_force',
</ins><span class="cx">         builderNames=base_buildernames),
</span><span class="cx"> #    ForceScheduler(
</span><del>-#        name="portbuilder_force",
</del><ins>+#        name='portbuilder_force',
</ins><span class="cx"> #        builderNames=portbuilder_buildernames,
</span><span class="cx"> #        properties=[StringParameter(
</span><del>-#            name="portname",
-#            label="Port name:",
-#            default="",
</del><ins>+#            name='portname',
+#            label='Port name:',
+#            default='',
</ins><span class="cx"> #            required=True)
</span><span class="cx"> #        ]),
</span><span class="cx">     ForceScheduler(
</span><del>-        name="portwatcher_force",
</del><ins>+        name='portwatcher_force',
</ins><span class="cx">         builderNames=portwatcher_buildernames,
</span><span class="cx">         properties=[StringParameter(
</span><del>-            name="portlist",
-            label="Port list:",
-            default="",
</del><ins>+            name='portlist',
+            label='Port list:',
+            default='',
</ins><span class="cx">             size=30,
</span><span class="cx">             required=True)
</span><span class="cx">         ])
</span><span class="lines">@@ -192,24 +192,24 @@
</span><span class="cx"> if 'www' in config['deploy']:
</span><span class="cx">     c['schedulers'] += [
</span><span class="cx">         SingleBranchScheduler(
</span><del>-                name="www",
</del><ins>+                name='www',
</ins><span class="cx">                 treeStableTimer=300,
</span><span class="cx">                 change_filter = wwwfilter,
</span><del>-                builderNames=["docs-www"]),
</del><ins>+                builderNames=['docs-www']),
</ins><span class="cx">         ForceScheduler(
</span><del>-            name="www_force",
-            builderNames=["docs-www"])]
</del><ins>+            name='www_force',
+            builderNames=['docs-www'])]
</ins><span class="cx"> 
</span><span class="cx"> if 'guide' in config['deploy']:
</span><span class="cx">     c['schedulers'] += [
</span><span class="cx">         SingleBranchScheduler(
</span><del>-                name="guide",
</del><ins>+                name='guide',
</ins><span class="cx">                 treeStableTimer=300,
</span><span class="cx">                 change_filter = guidefilter,
</span><del>-                builderNames=["docs-guide"]),
</del><ins>+                builderNames=['docs-guide']),
</ins><span class="cx">         ForceScheduler(
</span><del>-            name="guide_force",
-            builderNames=["docs-www"])]
</del><ins>+            name='guide_force',
+            builderNames=['docs-www'])]
</ins><span class="cx"> 
</span><span class="cx"> for i in range(len(portbuilder_buildernames)):
</span><span class="cx">     c['schedulers'].append(Triggerable(
</span><span class="lines">@@ -237,31 +237,31 @@
</span><span class="cx"> #   repourl=Interpolate('https://svn.macports.org/repository/macports/%(src::branch:-trunk)s/base'),
</span><span class="cx"> base_factory.addStep(SVN(
</span><span class="cx">     repourl='https://svn.macports.org/repository/macports/trunk/base',
</span><del>-    method="copy",
-    env={"PATH": path_ports}))
</del><ins>+    method='copy',
+    env={'PATH': path_ports}))
</ins><span class="cx"> base_factory.addStep(Configure(command=WithProperties("""
</span><span class="cx"> env PATH=/usr/bin:/bin:/usr/sbin:/sbin ./configure --enable-readline \
</span><span class="cx">     --prefix=%(workdir)s/opt/local \
</span><span class="cx">     --with-applications-dir=%(workdir)s/opt/local/Applications \
</span><span class="cx">     --with-install-user=`id -un` \
</span><span class="cx">     --with-install-group=`id -gn` \
</span><del>-"""),logfiles={"config.log": "config.log"}))
-base_factory.addStep(Compile(command="make -j`sysctl -n hw.activecpu`"))
</del><ins>+"""),logfiles={'config.log': 'config.log'}))
+base_factory.addStep(Compile(command='make -j`sysctl -n hw.activecpu`'))
</ins><span class="cx"> base_factory.addStep(ShellCommand(
</span><del>-    command="make install",
-    name="install",
-    description=["installing"],
-    descriptionDone=["install"]))
</del><ins>+    command='make install',
+    name='install',
+    description=['installing'],
+    descriptionDone=['install']))
</ins><span class="cx"> base_factory.addStep(ShellCommand(
</span><del>-    command="make test",
-    name="test",
-    description=["testing"],
-    descriptionDone=["test"]))
</del><ins>+    command='make test',
+    name='test',
+    description=['testing'],
+    descriptionDone=['test']))
</ins><span class="cx"> base_factory.addStep(ShellCommand(
</span><del>-    command=WithProperties("make distclean; rm -rf %(workdir)s/opt/local"),
-    name="clean",
-    description=["cleaning"],
-    descriptionDone=["clean"]))
</del><ins>+    command=WithProperties('make distclean; rm -rf %(workdir)s/opt/local'),
+    name='clean',
+    description=['cleaning'],
+    descriptionDone=['clean']))
</ins><span class="cx"> 
</span><span class="cx"> # custom class to make the file list available on the slave...
</span><span class="cx"> class SetPropertyFromCommandWithPortlist(SetPropertyFromCommand):
</span><span class="lines">@@ -284,7 +284,7 @@
</span><span class="cx"> 
</span><span class="cx">     def getText(self, cmd, results):
</span><span class="cx">         if self.hasProperty('subportlist'):
</span><del>-            return ["Port list: %s" % (self.getProperty('subportlist'))]
</del><ins>+            return ['Port list: %s' % (self.getProperty('subportlist'))]
</ins><span class="cx">         else:
</span><span class="cx">             # let ShellCommand describe
</span><span class="cx">             return ShellCommand.getText(self, cmd, results)
</span><span class="lines">@@ -317,16 +317,16 @@
</span><span class="cx">     url = c['buildbotURL']
</span><span class="cx">     if not url.endswith('/'):
</span><span class="cx">         url += '/'
</span><del>-    url += "builders/%s/builds/%s" % (buildername, buildnumber)
</del><ins>+    url += 'builders/%s/builds/%s' % (buildername, buildnumber)
</ins><span class="cx">     return url
</span><span class="cx"> 
</span><span class="cx"> class TriggerWithPortlist(Trigger):
</span><span class="cx">     def getSchedulersAndProperties(self):
</span><span class="cx">         sp = []
</span><span class="cx">         for scheduler in self.schedulerNames:
</span><del>-            for port in self.build.getProperty("subportlist").split():
</del><ins>+            for port in self.build.getProperty('subportlist').split():
</ins><span class="cx">                 props = self.set_properties.copy()
</span><del>-                props["portname"] = port
</del><ins>+                props['portname'] = port
</ins><span class="cx">                 sp.append([scheduler, props])
</span><span class="cx">         return sp
</span><span class="cx"> 
</span><span class="lines">@@ -341,32 +341,32 @@
</span><span class="cx">     # get mp-buildbot; we'll do the checkout of base and dports via these scripts
</span><span class="cx">     portwatcher_factory.addStep(SVN(
</span><span class="cx">         repourl=config['mpbbsvnurl'],
</span><del>-        env={"PATH": path_ports},
</del><ins>+        env={'PATH': path_ports},
</ins><span class="cx">         alwaysUseLatest=True,
</span><span class="cx">         preferLastChangedRev=True,
</span><del>-        mode="incremental",
-        workdir=os.path.join(portwatcher_factory.workdir, "mpbb"),
</del><ins>+        mode='incremental',
+        workdir=os.path.join(portwatcher_factory.workdir, 'mpbb'),
</ins><span class="cx">         haltOnFailure=True))
</span><span class="cx"> 
</span><span class="cx">     portwatcher_factory.addStep(ShellCommand(
</span><span class="cx">         command=['./mpbb/mpbb', '--prefix', WithProperties(prefix), 'cleanup'],
</span><del>-        name="cleanup",
-        description=["cleaning"],
-        descriptionDone=["clean"]))
</del><ins>+        name='cleanup',
+        description=['cleaning'],
+        descriptionDone=['clean']))
</ins><span class="cx"> 
</span><span class="cx">     portwatcher_factory.addStep(ShellCommand(
</span><span class="cx">         command=['./mpbb/mpbb', '--prefix', WithProperties(prefix), 'selfupdate'],
</span><del>-        name="selfupdate",
-        description=["updating", "MacPorts"],
-        descriptionDone=["update", "MacPorts"],
</del><ins>+        name='selfupdate',
+        description=['updating', 'MacPorts'],
+        descriptionDone=['update', 'MacPorts'],
</ins><span class="cx">         haltOnFailure=True))
</span><span class="cx"> 
</span><span class="cx">     portwatcher_factory.addStep(ShellCommand(
</span><span class="cx">         command=['./mpbb/mpbb', '--prefix', WithProperties(prefix), 'checkout', '--svn-url', config['svnurl']],
</span><span class="cx">         timeout=3600,
</span><del>-        name="checkout",
-        description=["syncing", "ports"],
-        descriptionDone=["sync", "ports"],
</del><ins>+        name='checkout',
+        description=['syncing', 'ports'],
+        descriptionDone=['sync', 'ports'],
</ins><span class="cx">         haltOnFailure=True))
</span><span class="cx"> 
</span><span class="cx">     def extract_subportlist(rc, stdout, stderr):
</span><span class="lines">@@ -382,19 +382,19 @@
</span><span class="cx">         """
</span><span class="cx">         if rc != 0:
</span><span class="cx">             # Set an empty subport list on error
</span><del>-            return {"subportlist": ""}
</del><ins>+            return {'subportlist': ''}
</ins><span class="cx">         subports = [x.strip() for x in stdout.splitlines()]
</span><del>-        return {"subportlist": " ".join(sorted(subports))}
</del><ins>+        return {'subportlist': ' '.join(sorted(subports))}
</ins><span class="cx"> 
</span><span class="cx">     portwatcher_factory.addStep(SetPropertyFromCommandWithPortlist(
</span><span class="cx">         command=WithProperties('./mpbb/mpbb list-subports %(fullportlist)s'),
</span><span class="cx">         extract_fn=extract_subportlist,
</span><del>-        name="subports",
-        description=["listing", "subports"]))
</del><ins>+        name='subports',
+        description=['listing', 'subports']))
</ins><span class="cx"> 
</span><span class="cx">     portwatcher_factory.addStep(TriggerWithPortlist(
</span><span class="cx">         schedulerNames=[triggerable],
</span><del>-        set_properties={"triggered_by": make_build_url},
</del><ins>+        set_properties={'triggered_by': make_build_url},
</ins><span class="cx">         waitForFinish=True,
</span><span class="cx">         updateSourceStamp=True))
</span><span class="cx"> 
</span><span class="lines">@@ -402,9 +402,9 @@
</span><span class="cx">     # (Current approach is not so useful as it is not incremental;
</span><span class="cx">     #  ideally this would already be displayed during the Trigger step.)
</span><span class="cx">     portwatcher_factory.addStep(ShellCommand(
</span><del>-        command=["cat", os.path.join(logdir, "ports-progress.txt")],
-        name="summary",
-        description=["summary"]))
</del><ins>+        command=['cat', os.path.join(logdir, 'ports-progress.txt')],
+        name='summary',
+        description=['summary']))
</ins><span class="cx"> 
</span><span class="cx">     return portwatcher_factory
</span><span class="cx"> 
</span><span class="lines">@@ -413,33 +413,33 @@
</span><span class="cx"> portbuilder_factory = BuildFactory()
</span><span class="cx"> portbuilder_factory.useProgress = False
</span><span class="cx"> portbuilder_factory.workdir = '../build'
</span><del>-logdir = os.path.join(portbuilder_factory.workdir, "logs")
</del><ins>+logdir = os.path.join(portbuilder_factory.workdir, 'logs')
</ins><span class="cx"> 
</span><span class="cx"> portbuilder_factory.addStep(Compile(
</span><span class="cx">     command=['./mpbb/mpbb', '--prefix', WithProperties(prefix), 'install-dependencies', WithProperties('%(portname)s')],
</span><del>-    name="install-dependencies",
-    description=["installing", "dependencies", "of", WithProperties("%(portname)s")],
-    descriptionDone=["install", "dependencies", "of", WithProperties("%(portname)s")],
-    logfiles={"dependencies": os.path.join(logdir, "dependencies-progress.txt")},
</del><ins>+    name='install-dependencies',
+    description=['installing', 'dependencies', 'of', WithProperties('%(portname)s')],
+    descriptionDone=['install', 'dependencies', 'of', WithProperties('%(portname)s')],
+    logfiles={'dependencies': os.path.join(logdir, 'dependencies-progress.txt')},
</ins><span class="cx">     haltOnFailure=True))
</span><span class="cx"> 
</span><span class="cx"> portbuilder_factory.addStep(Compile(
</span><span class="cx">     command=['./mpbb/mpbb', '--prefix', WithProperties(prefix), 'install-port', WithProperties('%(portname)s')],
</span><del>-    name="install-port",
-    description=["installing", WithProperties("%(portname)s")],
-    descriptionDone=["install", WithProperties("%(portname)s")],
</del><ins>+    name='install-port',
+    description=['installing', WithProperties('%(portname)s')],
+    descriptionDone=['install', WithProperties('%(portname)s')],
</ins><span class="cx">     logfiles={
</span><del>-        "files":      os.path.join(logdir, "port-contents.txt"),
-        "statistics": os.path.join(logdir, "port-statistics.txt"),
-        "main.log":   os.path.join(logdir, "main.log")
</del><ins>+        'files':      os.path.join(logdir, 'port-contents.txt'),
+        'statistics': os.path.join(logdir, 'port-statistics.txt'),
+        'main.log':   os.path.join(logdir, 'main.log')
</ins><span class="cx">     },
</span><span class="cx">     haltOnFailure=True))
</span><span class="cx"> 
</span><span class="cx"> portbuilder_factory.addStep(ShellCommand(
</span><span class="cx">     command=['./mpbb/mpbb', '--prefix', WithProperties(prefix), 'gather-archives', '--archive-site', config['archivesite'], '--staging-dir', ulpath],
</span><del>-    name="gather-archives",
-    description=["gathering", "archives"],
-    descriptionDone=["gather", "archives"],
</del><ins>+    name='gather-archives',
+    description=['gathering', 'archives'],
+    descriptionDone=['gather', 'archives'],
</ins><span class="cx">     haltOnFailure=True))
</span><span class="cx"> 
</span><span class="cx"> # upload archives from build slave to master
</span><span class="lines">@@ -450,10 +450,10 @@
</span><span class="cx"> # XXX: move deploy_archives.sh functionality to mp-buildbot
</span><span class="cx"> # sign generated binaries and sync to download server (if distributable)
</span><span class="cx"> if config['production']:
</span><del>-    portbuilder_factory.addStep(MasterShellCommand(command=["./deploy_archives.sh", WithProperties(ulpath_unique)],
-                                       name="deploy-archives",
-                                       description=["deploying", "archives"],
-                                       descriptionDone=["deploy", "archives"],
</del><ins>+    portbuilder_factory.addStep(MasterShellCommand(command=['./deploy_archives.sh', WithProperties(ulpath_unique)],
+                                       name='deploy-archives',
+                                       description=['deploying', 'archives'],
+                                       descriptionDone=['deploy', 'archives'],
</ins><span class="cx">                           env={'PRIVKEY': config['privkey'],
</span><span class="cx">                                'DLHOST': dlhost,
</span><span class="cx">                                'DLPATH': dlpath}))
</span><span class="lines">@@ -461,31 +461,31 @@
</span><span class="cx"> # TODO: do we want to upload the individual logs so maintainers can review them?
</span><span class="cx"> portbuilder_factory.addStep(ShellCommand(
</span><span class="cx">     command=['./mpbb/mpbb', '--prefix', WithProperties(prefix), 'cleanup'],
</span><del>-    name="cleanup",
-    description=["cleaning"],
-    descriptionDone=["clean"],
</del><ins>+    name='cleanup',
+    description=['cleaning'],
+    descriptionDone=['clean'],
</ins><span class="cx">     alwaysRun=True))
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> def make_rsync_deploy_steps(host, user, sshkeyfile, sshknownhostsfile, srcpath, destpath):
</span><span class="cx">     return [
</span><del>-        FileDownload(name="ssh key",
-                     description="transferring",
-                     descriptionDone="transfer",
</del><ins>+        FileDownload(name='ssh key',
+                     description='transferring',
+                     descriptionDone='transfer',
</ins><span class="cx">                      mastersrc=sshkeyfile,
</span><del>-                     slavedest="ssh_key",
</del><ins>+                     slavedest='ssh_key',
</ins><span class="cx">                      mode=0600),
</span><del>-        FileDownload(name="ssh known_hosts",
-                     description="transferring",
-                     descriptionDone="transfer",
</del><ins>+        FileDownload(name='ssh known_hosts',
+                     description='transferring',
+                     descriptionDone='transfer',
</ins><span class="cx">                      mastersrc=sshknownhostsfile,
</span><del>-                     slavedest="ssh_known_hosts",
</del><ins>+                     slavedest='ssh_known_hosts',
</ins><span class="cx">                      mode=0600),
</span><del>-        ShellCommand(name="rsync",
-                     description="deploying",
-                     descriptionDone="deploy",
-                     command="rsync -avzhC --delay-updates --delete-delay %s/ %s@%s:%s/" % (srcpath, user, host, destpath),
-                     env={'RSYNC_RSH': "ssh -i ssh_key -oUserKnownHostsFile=ssh_known_hosts"})
</del><ins>+        ShellCommand(name='rsync',
+                     description='deploying',
+                     descriptionDone='deploy',
+                     command='rsync -avzhC --delay-updates --delete-delay %s/ %s@%s:%s/' % (srcpath, user, host, destpath),
+                     env={'RSYNC_RSH': 'ssh -i ssh_key -oUserKnownHostsFile=ssh_known_hosts'})
</ins><span class="cx">     ]
</span><span class="cx"> 
</span><span class="cx"> if 'www' in config['deploy']:
</span><span class="lines">@@ -493,9 +493,9 @@
</span><span class="cx">     # TODO: incremental mode with cleanup?
</span><span class="cx">     docs_www_factory.addStep(SVN(
</span><span class="cx">         repourl='https://svn.macports.org/repository/macports/trunk/www',
</span><del>-        mode="full",
-        method="copy",
-        workdir="www"))
</del><ins>+        mode='full',
+        method='copy',
+        workdir='www'))
</ins><span class="cx">     # TODO: validate/lint files
</span><span class="cx">     docs_www_factory.addSteps(
</span><span class="cx">         make_rsync_deploy_steps(
</span><span class="lines">@@ -503,7 +503,7 @@
</span><span class="cx">             user=config['deploy']['www']['user'],
</span><span class="cx">             sshkeyfile=config['deploy']['www']['sshkeyfile'],
</span><span class="cx">             sshknownhostsfile=config['deploy']['www']['sshknownhostsfile'],
</span><del>-            srcpath="www",
</del><ins>+            srcpath='www',
</ins><span class="cx">             destpath=config['deploy']['www']['destpath']))
</span><span class="cx"> 
</span><span class="cx"> if 'guide' in config['deploy']:
</span><span class="lines">@@ -511,26 +511,26 @@
</span><span class="cx">     # TODO: incremental mode with cleanup?
</span><span class="cx">     docs_guide_factory.addStep(SVN(
</span><span class="cx">         repourl='https://svn.macports.org/repository/macports/trunk/doc-new',
</span><del>-        mode="full",
-        method="copy",
-        workdir="guide"))
</del><ins>+        mode='full',
+        method='copy',
+        workdir='guide'))
</ins><span class="cx">     # TODO: check for existence of tools in toolsprefix
</span><span class="cx">     docs_guide_factory.addStep(Compile(
</span><del>-        name="validate",
-        description="validating",
-        descriptionDone="validate",
-        command="make validate",
-        workdir="guide"))
</del><ins>+        name='validate',
+        description='validating',
+        descriptionDone='validate',
+        command='make validate',
+        workdir='guide'))
</ins><span class="cx">     docs_guide_factory.addStep(Compile(
</span><del>-        command="make all",
-        workdir="guide"))
</del><ins>+        command='make all',
+        workdir='guide'))
</ins><span class="cx">     docs_guide_factory.addSteps(
</span><span class="cx">         make_rsync_deploy_steps(
</span><span class="cx">             host=config['deploy']['guide']['host'], 
</span><span class="cx">             user=config['deploy']['guide']['user'],
</span><span class="cx">             sshkeyfile=config['deploy']['guide']['sshkeyfile'],
</span><span class="cx">             sshknownhostsfile=config['deploy']['guide']['sshknownhostsfile'],
</span><del>-            srcpath="guide",
</del><ins>+            srcpath='guide',
</ins><span class="cx">             destpath=config['deploy']['guide']['destpath']))
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="lines">@@ -543,59 +543,59 @@
</span><span class="cx"> baseslaves = {}
</span><span class="cx"> slavenames = slavedata['slaves'].keys()
</span><span class="cx"> for plat in build_platforms:
</span><del>-    baseslaves[plat]  = filter(lambda x: x.endswith(plat+"-base"),  slavenames)
-    portsslaves[plat] = filter(lambda x: x.endswith(plat+"-ports"), slavenames)
</del><ins>+    baseslaves[plat]  = filter(lambda x: x.endswith(plat+'-base'),  slavenames)
+    portsslaves[plat] = filter(lambda x: x.endswith(plat+'-ports'), slavenames)
</ins><span class="cx"> 
</span><span class="cx"> env_buildinfo = {
</span><del>-    "BUILDBOT_BUILDERNAME": WithProperties("%(buildername)s"),
-    "BUILDBOT_BUILDNUMBER": WithProperties("%(buildnumber)s"),
-    "BUILDBOT_BUILDURL": make_build_url
</del><ins>+    'BUILDBOT_BUILDERNAME': WithProperties('%(buildername)s'),
+    'BUILDBOT_BUILDNUMBER': WithProperties('%(buildnumber)s'),
+    'BUILDBOT_BUILDURL': make_build_url
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> c['builders']=[]
</span><del>-extract_os = re.compile("10\.\d+")
</del><ins>+extract_os = re.compile('10\.\d+')
</ins><span class="cx"> for plat in build_platforms:
</span><span class="cx">     os_match = extract_os.search(plat)
</span><span class="cx">     os_version = os_match.group(0) if os_match else plat
</span><span class="cx">     if 'legacy' not in plat and '10.6_i386' not in plat:
</span><span class="cx">         c['builders'] += [
</span><span class="cx">             BuilderConfig(
</span><del>-                name="base-" + plat,
-                slavenames=["base-" + plat],
</del><ins>+                name='base-' + plat,
+                slavenames=['base-' + plat],
</ins><span class="cx">                 factory=base_factory,
</span><del>-                tags=["base", os_version],
-                env=merge_dicts(env_buildinfo, {"PATH": path_base}))]
</del><ins>+                tags=['base', os_version],
+                env=merge_dicts(env_buildinfo, {'PATH': path_base}))]
</ins><span class="cx">     if 'linux' not in plat and '10.5_ppc' != plat:
</span><span class="cx">         c['builders'] += [
</span><span class="cx">             BuilderConfig(
</span><del>-                name="ports-" + plat + "-watcher",
-                slavenames=["ports-" + plat],
-                factory=make_portwatcher_factory("ports-" + plat + "-trigger"),
-                tags=["portwatcher", os_version],
-                env=merge_dicts(env_buildinfo, {"PATH": path_ports})),
</del><ins>+                name='ports-' + plat + '-watcher',
+                slavenames=['ports-' + plat],
+                factory=make_portwatcher_factory('ports-' + plat + '-trigger'),
+                tags=['portwatcher', os_version],
+                env=merge_dicts(env_buildinfo, {'PATH': path_ports})),
</ins><span class="cx">             BuilderConfig(
</span><del>-                name="ports-" + plat + "-builder",
-                slavenames=["ports-" + plat],
</del><ins>+                name='ports-' + plat + '-builder',
+                slavenames=['ports-' + plat],
</ins><span class="cx">                 factory=portbuilder_factory,
</span><del>-                tags=["portbuilder", os_version],
-                env=merge_dicts(env_buildinfo, {"PATH": path_ports}))]
</del><ins>+                tags=['portbuilder', os_version],
+                env=merge_dicts(env_buildinfo, {'PATH': path_ports}))]
</ins><span class="cx"> 
</span><span class="cx"> if 'www' in config['deploy']:
</span><span class="cx">     c['builders'].append(
</span><span class="cx">         BuilderConfig(
</span><del>-            name="docs-www",
-            slavenames=["docs"],
</del><ins>+            name='docs-www',
+            slavenames=['docs'],
</ins><span class="cx">             factory=docs_www_factory,
</span><del>-            tags=["docs", "www"],
-            env=merge_dicts(env_buildinfo, {"PATH": path_ports})))
</del><ins>+            tags=['docs', 'www'],
+            env=merge_dicts(env_buildinfo, {'PATH': path_ports})))
</ins><span class="cx"> if 'guide' in config['deploy']:
</span><span class="cx">     c['builders'].append(
</span><span class="cx">         BuilderConfig(
</span><del>-            name="docs-guide",
-            slavenames=["docs"],
</del><ins>+            name='docs-guide',
+            slavenames=['docs'],
</ins><span class="cx">             factory=docs_guide_factory,
</span><del>-            tags=["docs", "guide"],
-            env=merge_dicts(env_buildinfo, {"PATH": path_ports})))
</del><ins>+            tags=['docs', 'guide'],
+            env=merge_dicts(env_buildinfo, {'PATH': path_ports})))
</ins><span class="cx"> 
</span><span class="cx"> ####### STATUS TARGETS
</span><span class="cx"> 
</span><span class="lines">@@ -642,11 +642,11 @@
</span><span class="cx">         interestedUsers = set()
</span><span class="cx"> 
</span><span class="cx">         # XXX: needs to be rewritten for the new steps of mp-buildbot
</span><del>-        statusStep = [x for x in build.getSteps() if x.getName() == "status"][0]
-        statusLog = [x for x in statusStep.getLogs() if x.getName() == "portstatus"][0]
</del><ins>+        statusStep = [x for x in build.getSteps() if x.getName() == 'status'][0]
+        statusLog = [x for x in statusStep.getLogs() if x.getName() == 'portstatus'][0]
</ins><span class="cx">         for line in statusLog.getText().splitlines():
</span><span class="cx">             halves = line.split()
</span><del>-            if halves[0] == "[FAIL]":
</del><ins>+            if halves[0] == '[FAIL]':
</ins><span class="cx">                 failedPorts.add(halves[1])
</span><span class="cx">         
</span><span class="cx">         fakeAddresses = {'nomaintainer', 'nomaintainer@macports.org', 'openmaintainer', 'openmaintainer@macports.org'}
</span><span class="lines">@@ -707,21 +707,21 @@
</span><span class="cx"> def portWatcherMessageFormatter(mode, name, build, results, master_status, interested_users):
</span><span class="cx">     result = util.Results[results]
</span><span class="cx">     text = list()
</span><del>-    text.append("Status:       {:s}".format(result.title()))
-    text.append("Build slave:  {:s}".format(build.getSlavename()))
</del><ins>+    text.append('Status:       {:s}'.format(result.title()))
+    text.append('Build slave:  {:s}'.format(build.getSlavename()))
</ins><span class="cx">     if master_status.getURLForThing(build):
</span><del>-        text.append("Full logs:    {:s}".format(master_status.getURLForThing(build)))
-        text.append("Build reason: {:s}".format(build.getReason()))
-        text.append("Port list:    {:s}".format(build.getProperty('fullportlist')))
-        text.append("Subport list:\n\t- {:s}".format(build.getProperty('subportlist').replace(" ", "\n\t- ")))
-        text.append("Variants:     {:s}".format(build.getProperty('variants')))
-        text.append("Revision:     {:s}".format(build.getProperty('revision')))
-        text.append("Build time:   {:s}".format(datetime.timedelta(seconds=int(round(build.getTimes()[1] - build.getTimes()[0])))))
-        text.append(u"Committer:    {:s}".format(",".join(build.getResponsibleUsers())))
</del><ins>+        text.append('Full logs:    {:s}'.format(master_status.getURLForThing(build)))
+        text.append('Build reason: {:s}'.format(build.getReason()))
+        text.append('Port list:    {:s}'.format(build.getProperty('fullportlist')))
+        text.append('Subport list:\n\t- {:s}'.format(build.getProperty('subportlist').replace(' ', '\n\t- ')))
+        text.append('Variants:     {:s}'.format(build.getProperty('variants')))
+        text.append('Revision:     {:s}'.format(build.getProperty('revision')))
+        text.append('Build time:   {:s}'.format(datetime.timedelta(seconds=int(round(build.getTimes()[1] - build.getTimes()[0])))))
+        text.append(u'Committer:    {:s}'.format(','.join(build.getResponsibleUsers())))
</ins><span class="cx"> 
</span><del>-        text.append("\nLog from failed builds:")
-        summary_step = [x for x in build.getSteps() if x.getName() == "summary"][0]
-        summary_log  = [x for x in summary_step.getLogs() if x.getName() == "stdio"][0]
</del><ins>+        text.append('\nLog from failed builds:')
+        summary_step = [x for x in build.getSteps() if x.getName() == 'summary'][0]
+        summary_log  = [x for x in summary_step.getLogs() if x.getName() == 'stdio'][0]
</ins><span class="cx">         failed_ports = set()
</span><span class="cx">         maintainers_to_notify = set()
</span><span class="cx">         pattern = re.compile("^Building '(?P<port>.*?)'.*?(\(failed to install dependency '(?P<dependency>.*?)'\))?( maintainers: (?P<maintainers>.*?)[.])?$")
</span><span class="lines">@@ -730,7 +730,7 @@
</span><span class="cx">             # in case of a build error, print the error and add the broken port(s) to the list
</span><span class="cx">             if 'ERROR' in line:
</span><span class="cx">                 line = line.replace(';', '@')
</span><del>-                text.append("\t" + line.replace(" maintainers:", "\n\t> maintainers:"))
</del><ins>+                text.append('\t' + line.replace(' maintainers:', '\n\t> maintainers:'))
</ins><span class="cx">                 match = pattern.match(line)
</span><span class="cx">                 if match:
</span><span class="cx">                     for key in ['port', 'dependency']:
</span><span class="lines">@@ -742,33 +742,33 @@
</span><span class="cx">                         for maintainer in maintainers.split(','):
</span><span class="cx">                             maintainers_to_notify.add(maintainer)
</span><span class="cx">         if len(failed_ports) > 0:
</span><del>-            text.append("\nBroken ports:\n\t- {:s}".format("\n\t- ".join(sorted(failed_ports))))
</del><ins>+            text.append('\nBroken ports:\n\t- {:s}'.format('\n\t- '.join(sorted(failed_ports))))
</ins><span class="cx"> 
</span><span class="cx">         if len(maintainers_to_notify) > 0:
</span><del>-            text.append("\nResponsible maintainers:\n\t- {}".format("\n\t- ".join(sorted(maintainers_to_notify))))
</del><ins>+            text.append('\nResponsible maintainers:\n\t- {}'.format('\n\t- '.join(sorted(maintainers_to_notify))))
</ins><span class="cx">             for user in maintainers_to_notify:
</span><span class="cx">                 interested_users.add(user)
</span><span class="cx"> 
</span><span class="cx">         # links to individual builds
</span><del>-        text.append("\nLinks to individual build jobs:")
-        trigger_step = [x for x in build.getSteps() if x.getName() == "trigger"][0]
</del><ins>+        text.append('\nLinks to individual build jobs:')
+        trigger_step = [x for x in build.getSteps() if x.getName() == 'trigger'][0]
</ins><span class="cx">         build_urls_dict = trigger_step.getURLs()
</span><span class="cx">         # TODO; sorting won't work properly for
</span><span class="cx">         # - ports-10.11-x86_64-builder #99
</span><span class="cx">         # - ports-10.11-x86_64-builder #100
</span><span class="cx">         build_urls_keys = sorted(build_urls_dict.keys())
</span><span class="cx">         for k in build_urls_keys:
</span><del>-            text.append("- {:s}\n  {:s}".format(k, build_urls_dict[k]))
-        text.append("\n-- \nBest regards,\nMacPorts Buildbot\n{:s}".format(c['buildbotURL']))
</del><ins>+            text.append('- {:s}\n  {:s}'.format(k, build_urls_dict[k]))
+        text.append('\n-- \nBest regards,\nMacPorts Buildbot\n{:s}'.format(c['buildbotURL']))
</ins><span class="cx"> 
</span><del>-        subject = "Build {:s}".format(result.title())
</del><ins>+        subject = 'Build {:s}'.format(result.title())
</ins><span class="cx">         if failed_ports:
</span><del>-            subject += ": "
-            subject += ", ".join(sorted(failed_ports)[:10])
</del><ins>+            subject += ': '
+            subject += ', '.join(sorted(failed_ports)[:10])
</ins><span class="cx">             if len(failed_ports) > 10:
</span><del>-                subject +=  ", and {} more".format(len(failed_ports) - 10)
</del><ins>+                subject +=  ', and {} more'.format(len(failed_ports) - 10)
</ins><span class="cx">     return {
</span><del>-        'body'    : "\n".join(text),
</del><ins>+        'body'    : '\n'.join(text),
</ins><span class="cx">         'type'    : 'plain',
</span><span class="cx">         'subject' : subject
</span><span class="cx">     }
</span><span class="lines">@@ -776,38 +776,38 @@
</span><span class="cx"> if config['production']:
</span><span class="cx">     # send mail about base failures to users on the blamelist
</span><span class="cx">     mn = MailNotifier(
</span><del>-        fromaddr="buildbot@macports.org",
-        extraHeaders={"Reply-To": "noreply@macports.org"},
</del><ins>+        fromaddr='buildbot@macports.org',
+        extraHeaders={'Reply-To': 'noreply@macports.org'},
</ins><span class="cx">         # unless lookup is defined, users have to be configured locally
</span><del>-        # maybe a smarter function is needed, but lookup="" does it for now
-        lookup="",
-        mode=("problem"),
</del><ins>+        # maybe a smarter function is needed, but lookup='' does it for now
+        lookup='',
+        mode=('problem'),
</ins><span class="cx">         builders=base_buildernames,
</span><del>-        #extraRecipients=["..."],
</del><ins>+        #extraRecipients=['...'],
</ins><span class="cx">         #smtpPort=25,
</span><del>-        #relayhost="localhost",
</del><ins>+        #relayhost='localhost',
</ins><span class="cx">         sendToInterestedUsers=True)
</span><span class="cx">     c['status'].append(mn)
</span><span class="cx"> 
</span><span class="cx">     mn = PortsMailNotifier(
</span><del>-        fromaddr="buildbot@macports.org",
-        extraHeaders={"Reply-To": "noreply@macports.org"},
-        lookup="",
-        mode=("failing"),
</del><ins>+        fromaddr='buildbot@macports.org',
+        extraHeaders={'Reply-To': 'noreply@macports.org'},
+        lookup='',
+        mode=('failing'),
</ins><span class="cx">         builders=portwatcher_buildernames,
</span><del>-        #extraRecipients=["..."],
</del><ins>+        #extraRecipients=['...'],
</ins><span class="cx">         #smtpPort=25,
</span><del>-        #relayhost="localhost",
</del><ins>+        #relayhost='localhost',
</ins><span class="cx">         sendToInterestedUsers=True,
</span><span class="cx">         portMessageFormatter=portWatcherMessageFormatter)
</span><span class="cx">     c['status'].append(mn)
</span><span class="cx"> 
</span><span class="cx">     # notifications about exceptions
</span><span class="cx">     mn = MailNotifier(
</span><del>-        fromaddr="buildbot@macports.org",
-        extraHeaders={"Reply-To": "noreply@macports.org"},
-        mode=("exception"),
-        extraRecipients=["admin@macports.org"],
</del><ins>+        fromaddr='buildbot@macports.org',
+        extraHeaders={'Reply-To': 'noreply@macports.org'},
+        mode=('exception'),
+        extraRecipients=['admin@macports.org'],
</ins><span class="cx">         sendToInterestedUsers=False)
</span><span class="cx">     c['status'].append(mn)
</span><span class="cx"> 
</span><span class="lines">@@ -819,14 +819,14 @@
</span><span class="cx"> # installation's html.WebStatus home page (linked to the
</span><span class="cx"> # 'titleURL') and is embedded in the title of the waterfall HTML page.
</span><span class="cx"> 
</span><del>-c['title'] = "MacPorts"
-c['titleURL'] = "https://www.macports.org/"
</del><ins>+c['title'] = 'MacPorts'
+c['titleURL'] = 'https://www.macports.org/'
</ins><span class="cx"> 
</span><span class="cx"> c['buildbotURL'] = config['buildboturl']
</span><span class="cx"> c['status'].append(html.WebStatus(
</span><span class="cx">     http_port=config['httpport'],
</span><span class="cx">     authz=authz_cfg,
</span><del>-    changecommentlink=(r"#(\d+)", r"https://trac.macports.org/ticket/\1", r"Ticket \g<0>")
</del><ins>+    changecommentlink=(r'#(\d+)', r'https://trac.macports.org/ticket/\1', r'Ticket \g<0>')
</ins><span class="cx"> ))
</span><span class="cx"> 
</span><span class="cx"> c['revlink'] = util.RevlinkMatch([r'https://svn.macports.org/repository/macports/(.*)'],
</span><span class="lines">@@ -838,7 +838,7 @@
</span><span class="cx"> c['db'] = {
</span><span class="cx">     # This specifies what database buildbot uses to store its state.  You can leave
</span><span class="cx">     # this at its default for all but the largest installations.
</span><del>-    'db_url' : "sqlite:///state.sqlite",
</del><ins>+    'db_url' : 'sqlite:///state.sqlite',
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>