Add tox.ini file and fix pep8 errors.

Add tox.ini file and fix up several pep8 failures.

Change-Id: I3c64d2e790a8dfe37aa9091b001c3a5b85bc8586
Reviewed-on: https://review.openstack.org/20661
Reviewed-by: Jeremy Stanley <fungi@yuggoth.org>
Reviewed-by: Dan Prince <dprince@redhat.com>
Approved: Dan Prince <dprince@redhat.com>
Tested-by: Jenkins
This commit is contained in:
Elizabeth Krumbach 2013-01-28 16:31:46 -08:00 committed by Jenkins
parent 06dd3036c7
commit 932bfca9cc
5 changed files with 67 additions and 56 deletions

View File

@ -5,11 +5,11 @@ import json
def reviews(project, status="open", branch="master"):
arr = []
cmd = 'ssh review gerrit' \
' query "status: %s project: openstack/%s branch: %s"' \
' --current-patch-set --format JSON' \
% (status, project, branch)
'query "status: %s project: openstack/%s branch: %s"' \
' --current-patch-set --format JSON' \
% (status, project, branch)
p = subprocess.Popen([cmd], shell=True, stdin=subprocess.PIPE,
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
stdout = p.stdout
for line in stdout.readlines():
review = json.loads(line)

View File

@ -5,7 +5,8 @@ class LaunchPad(object):
def __init__(self):
self.lp = Launchpad.login_anonymously('reviewday', 'production',
'~/.launchpadlib-reviewday', version="devel")
'~/.launchpadlib-reviewday',
version="devel")
self.spec_cache = {}
def bug(self, id):

View File

@ -20,21 +20,21 @@ class MergeProp(object):
cause = 'No link'
cause_score = {
'Regression hotfix': 350,
'Critical bugfix': 340,
'Essential feature': 330,
'High feature': 230,
'Medium feature': 180,
'High bugfix': 130,
'Low feature': 100,
'Medium bugfix': 70,
'Low bugfix': 50,
'Undefined feature': 40,
'Wishlist bugfix': 35,
'Undecided bugfix': 30,
'Untargeted feature': 10,
'No link': 0,
}
'Regression hotfix': 350,
'Critical bugfix': 340,
'Essential feature': 330,
'High feature': 230,
'Medium feature': 180,
'High bugfix': 130,
'Low feature': 100,
'Medium bugfix': 70,
'Low bugfix': 50,
'Undefined feature': 40,
'Wishlist bugfix': 35,
'Undecided bugfix': 30,
'Untargeted feature': 10,
'No link': 0,
}
return (cause, cause_score[cause])

View File

@ -6,47 +6,47 @@ def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(
name = "reviewday",
version = "0.2.0",
author = "Dan Prince",
author_email = "dan.prince@rackspace.com",
description = ("Report generator for OpenStack code reviews."),
license = "BSD",
keywords = "OpenStack HTML report generator",
url = "https://github/dprince/reviewday",
packages = ['reviewday'],
long_description = read('README.md'),
classifiers = [
name="reviewday",
version="0.2.0",
author="Dan Prince",
author_email="dan.prince@rackspace.com",
description=("Report generator for OpenStack code reviews."),
license="BSD",
keywords="OpenStack HTML report generator",
url="https://github/dprince/reviewday",
packages=['reviewday'],
long_description=read('README.md'),
classifiers=[
"Development Status :: 4 - Beta",
"Topic :: Utilities",
"License :: OSI Approved :: BSD License",
],
scripts = ['bin/reviewday'],
data_files = [
('reviewday', ['reviewday/report.html']),
('reviewday/report_files', [
'reviewday/report_files/arrowBlank',
'reviewday/report_files/arrowDown',
'reviewday/report_files/arrowUp',
'reviewday/report_files/combo.css',
'reviewday/report_files/CRITICALBUGFIX.png',
'reviewday/report_files/ESSENTIALFEATURE.png',
'reviewday/report_files/HIGHBUGFIX.png',
'reviewday/report_files/HIGHFEATURE.png',
'reviewday/report_files/LOWBUGFIX.png',
'reviewday/report_files/LOWFEATURE.png',
'reviewday/report_files/MEDIUMBUGFIX.png',
'reviewday/report_files/MEDIUMFEATURE.png',
'reviewday/report_files/NOLINK.png',
'reviewday/report_files/REGRESSIONHOTFIX.png',
'reviewday/report_files/RELEASECRITICALBUG.png',
'reviewday/report_files/sorting.js',
'reviewday/report_files/UNDECIDEDBUGFIX.png',
'reviewday/report_files/UNTARGETEDFEATURE.png',
'reviewday/report_files/WISHLISTBUGFIX.png',
])
scripts=['bin/reviewday'],
data_files=[
('reviewday', ['reviewday/report.html']),
('reviewday/report_files', [
'reviewday/report_files/arrowBlank',
'reviewday/report_files/arrowDown',
'reviewday/report_files/arrowUp',
'reviewday/report_files/combo.css',
'reviewday/report_files/CRITICALBUGFIX.png',
'reviewday/report_files/ESSENTIALFEATURE.png',
'reviewday/report_files/HIGHBUGFIX.png',
'reviewday/report_files/HIGHFEATURE.png',
'reviewday/report_files/LOWBUGFIX.png',
'reviewday/report_files/LOWFEATURE.png',
'reviewday/report_files/MEDIUMBUGFIX.png',
'reviewday/report_files/MEDIUMFEATURE.png',
'reviewday/report_files/NOLINK.png',
'reviewday/report_files/REGRESSIONHOTFIX.png',
'reviewday/report_files/RELEASECRITICALBUG.png',
'reviewday/report_files/sorting.js',
'reviewday/report_files/UNDECIDEDBUGFIX.png',
'reviewday/report_files/UNTARGETEDFEATURE.png',
'reviewday/report_files/WISHLISTBUGFIX.png',
])
],
install_requires = [
install_requires=[
"launchpadlib",
"cheetah",
],

10
tox.ini Normal file
View File

@ -0,0 +1,10 @@
[tox]
envlist = pyflakes, pep8, py27
[testenv:pyflakes]
deps = pyflakes
commands = pyflakes setup.py reviewday bin
[testenv:pep8]
deps = pep8==1.3.3
commands = pep8 --ignore=E125 --repeat --show-source --exclude=.tox .