Skip to content

Commit

Permalink
hush most non-trivial pyflakes warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
warner committed Feb 15, 2010
1 parent 58c6c61 commit e6cfbda
Show file tree
Hide file tree
Showing 16 changed files with 13 additions and 37 deletions.
2 changes: 1 addition & 1 deletion buildbot/changes/bonsaipoller.py
Expand Up @@ -113,7 +113,7 @@ def _parseData(self):

except NoMoreCiNodes:
pass
except InvalidResultError, EmptyResult:
except (InvalidResultError, EmptyResult):
raise

return BonsaiResult(nodes)
Expand Down
2 changes: 1 addition & 1 deletion buildbot/changes/freshcvs.py
Expand Up @@ -18,7 +18,7 @@ class FreshCVSListener(pb.Referenceable):
def remote_notify(self, root, files, message, user):
try:
self.source.notify(root, files, message, user)
except Exception, e:
except Exception:
print "notify failed"
log.err()

Expand Down
1 change: 0 additions & 1 deletion buildbot/changes/pb.py
Expand Up @@ -19,7 +19,6 @@ def detached(self, mind):
def perspective_addChange(self, changedict):
log.msg("perspective_addChange called")
pathnames = []
prefixpaths = None
for path in changedict['files']:
if self.prefix:
if not path.startswith(self.prefix):
Expand Down
1 change: 0 additions & 1 deletion buildbot/changes/svnpoller.py
Expand Up @@ -403,7 +403,6 @@ def create_changes(self, new_logentries):
changes = []

for el in new_logentries:
branch_files = [] # get oldest change first
revision = str(el.getAttribute("revision"))

revlink=''
Expand Down
2 changes: 1 addition & 1 deletion buildbot/clients/base.py
@@ -1,5 +1,5 @@

import sys, re
import re

from twisted.spread import pb
from twisted.cred import credentials, error
Expand Down
9 changes: 3 additions & 6 deletions buildbot/status/web/baseweb.py
@@ -1,6 +1,5 @@

import os, sys, urllib, weakref
from itertools import count
import os, weakref

from zope.interface import implements
from twisted.python import log
Expand All @@ -9,11 +8,9 @@
from twisted.spread import pb
from twisted.web.util import Redirect

from buildbot.interfaces import IControl, IStatusReceiver
from buildbot.interfaces import IStatusReceiver

from buildbot.status.web.base import HtmlResource, \
build_get_class, ICurrentBox, BuildLineMixin, map_branches, \
StaticFile, path_to_root, createJinjaEnv
from buildbot.status.web.base import StaticFile, createJinjaEnv
from buildbot.status.web.feeds import Rss20StatusResource, \
Atom10StatusResource
from buildbot.status.web.waterfall import WaterfallStatusResource
Expand Down
1 change: 0 additions & 1 deletion buildbot/status/web/build.py
@@ -1,6 +1,5 @@

from twisted.web import html
from twisted.web.error import NoResource
from twisted.web.util import Redirect, DeferredResource
from twisted.internet import defer, reactor

Expand Down
12 changes: 0 additions & 12 deletions buildbot/status/web/grid.py
@@ -1,20 +1,8 @@
from __future__ import generators

import sys, os.path

from buildbot.status.web.base import HtmlResource
from buildbot.status.web.base import build_get_class, path_to_builder, path_to_build

# set grid_css to the full pathname of the css file
if hasattr(sys, "frozen"):
# all 'data' files are in the directory of our executable
here = os.path.dirname(sys.executable)
grid_css = os.path.abspath(os.path.join(here, "grid.css"))
else:
# running from source; look for a sibling to __file__
up = os.path.dirname
grid_css = os.path.abspath(os.path.join(up(__file__), "grid.css"))

class ANYBRANCH: pass # a flag value, used below

class GridStatusMixin(object):
Expand Down
2 changes: 0 additions & 2 deletions buildbot/status/web/olpb.py
@@ -1,6 +1,4 @@

import os, sys

from buildbot.status.web.base import HtmlResource, BuildLineMixin, map_branches

# /one_line_per_build
Expand Down
2 changes: 1 addition & 1 deletion buildbot/status/web/slaves.py
Expand Up @@ -121,7 +121,7 @@ def content(self, request, ctx):

def getChild(self, path, req):
try:
slave = self.getStatus(req).getSlave(path)
self.getStatus(req).getSlave(path)
return OneBuildSlaveResource(path)
except KeyError:
return NoResource("No such slave '%s'" % html.escape(path))
5 changes: 3 additions & 2 deletions buildbot/status/web/status_json.py
Expand Up @@ -8,11 +8,12 @@
import re

try:
import simplejson as json
import simplejson
json = simplejson # this hushes pyflakes
except ImportError:
import json

from buildbot.status.web.base import HtmlResource, StaticHTML
from buildbot.status.web.base import HtmlResource
from twisted.web import error, html, resource


Expand Down
4 changes: 0 additions & 4 deletions buildbot/status/web/waterfall.py
Expand Up @@ -2,7 +2,6 @@

from zope.interface import implements
from twisted.python import log, components
from twisted.web import html
import urllib

import time
Expand Down Expand Up @@ -101,9 +100,6 @@ def getBox(self, req):
if not builds:
return Box(["none"], class_="LastBuild")
b = builds[0]
name = b.getBuilder().getName()
number = b.getNumber()
url = path_to_build(req, b)
text = b.getText()
tests_failed = b.getSummaryStatistic('tests-failed', operator.add, 0)
if tests_failed: text.extend(["Failed tests: %d" % tests_failed])
Expand Down
2 changes: 1 addition & 1 deletion buildbot/steps/master.py
Expand Up @@ -81,7 +81,7 @@ def start(self):
self.step_status.setText(list(self.description))

# TODO add a timeout?
proc = reactor.spawnProcess(self.LocalPP(self), argv[0], argv)
reactor.spawnProcess(self.LocalPP(self), argv[0], argv)
# (the LocalPP object will call processEnded for us)

def processEnded(self, status_object):
Expand Down
2 changes: 1 addition & 1 deletion buildbot/steps/shell.py
Expand Up @@ -6,6 +6,7 @@
from buildbot.process.buildstep import LoggingBuildStep, RemoteShellCommand
from buildbot.process.buildstep import RemoteCommand
from buildbot.status.builder import SUCCESS, WARNINGS, FAILURE, STDOUT, STDERR
from buildbot.interfaces import BuildSlaveTooOldError

# for existing configurations that import WithProperties from here. We like
# to move this class around just to keep our readers guessing.
Expand Down Expand Up @@ -211,7 +212,6 @@ def start(self):

# check for the usePTY flag
if kwargs.has_key('usePTY') and kwargs['usePTY'] != 'slave-config':
slavever = self.slaveVersion("shell", "old")
if self.slaveVersionIsOlderThan("svn", "2.7"):
warnings.append("NOTE: slave does not allow master to override usePTY\n")

Expand Down
1 change: 0 additions & 1 deletion buildbot/steps/transfer.py
Expand Up @@ -63,7 +63,6 @@ def _extractall(self, path=".", members=None):
"""Fallback extractall method for TarFile, in case it doesn't have its own."""

import copy
import operator #@UnusedImport

directories = []

Expand Down
2 changes: 1 addition & 1 deletion buildbot/util.py
Expand Up @@ -74,7 +74,7 @@ def _runCallbacks(self):

def ignoreStaleRefs(failure):
"""d.addErrback(util.ignoreStaleRefs)"""
r = failure.trap(pb.DeadReferenceError, pb.PBConnectionLost)
failure.trap(pb.DeadReferenceError, pb.PBConnectionLost)
return None

class _None:
Expand Down

0 comments on commit e6cfbda

Please sign in to comment.