Merge lp:~danilo/linaro-license-protection/pep8-cleanups into lp:~linaro-automation/linaro-license-protection/trunk

Proposed by Данило Шеган
Status: Merged
Approved by: Stevan Radaković
Approved revision: 153
Merged at revision: 152
Proposed branch: lp:~danilo/linaro-license-protection/pep8-cleanups
Merge into: lp:~linaro-automation/linaro-license-protection/trunk
Diff against target: 118 lines (+13/-15)
6 files modified
license_protected_downloads/render_text_files.py (+3/-2)
license_protected_downloads/tests/helpers.py (+0/-1)
license_protected_downloads/tests/test_pep8.py (+2/-5)
license_protected_downloads/tests/test_views.py (+2/-1)
scripts/publish_to_snapshots.py (+5/-5)
settings.py (+1/-1)
To merge this branch: bzr merge lp:~danilo/linaro-license-protection/pep8-cleanups
Reviewer Review Type Date Requested Status
Stevan Radaković Approve
Review via email: mp+136893@code.launchpad.net

Description of the change

PEP8 cleanups.

To post a comment you must log in.
Revision history for this message
Stevan Radaković (stevanr) wrote :

Looks good, thanks.
Approve +1.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'license_protected_downloads/render_text_files.py'
2--- license_protected_downloads/render_text_files.py 2012-11-21 17:08:15 +0000
3+++ license_protected_downloads/render_text_files.py 2012-11-29 10:18:21 +0000
4@@ -76,8 +76,9 @@
5 ubuntupaths = cls.dirEntries(path, files_list=settings.LINUX_FILES)
6 if len(androidpaths) > 0 and len(ubuntupaths) > 0:
7 # Files from ANDROID_FILES and LINUX_FILES exist in the same dir
8- raise MultipleFilesException("Both Android and Ubuntu HOWTO " \
9- "files are found, which is unsupported.")
10+ raise MultipleFilesException(
11+ "Both Android and Ubuntu HOWTO files "
12+ "are found, which is unsupported.")
13 else:
14 if len(androidpaths) > 0:
15 return androidpaths
16
17=== modified file 'license_protected_downloads/tests/helpers.py'
18--- license_protected_downloads/tests/helpers.py 2012-11-28 12:08:35 +0000
19+++ license_protected_downloads/tests/helpers.py 2012-11-29 10:18:21 +0000
20@@ -39,4 +39,3 @@
21 target.write(data)
22 target.close()
23 return full_path
24-
25
26=== modified file 'license_protected_downloads/tests/test_pep8.py'
27--- license_protected_downloads/tests/test_pep8.py 2012-08-17 15:09:12 +0000
28+++ license_protected_downloads/tests/test_pep8.py 2012-11-29 10:18:21 +0000
29@@ -23,11 +23,8 @@
30
31 class TestPep8(TestCase):
32 def test_pep8(self):
33- # Errors we have to ignore for now:
34- # * E202 whitespace before ')' or ']'
35- # E202 is actually only reported with the natty version of pep8 and
36- # can be re-enabled once we drop support for natty.
37- ignore = ['E202']
38+ # Errors we have to ignore for now: use pep8 error codes like 'E202'.
39+ ignore = []
40 # Ignore return code.
41 proc = subprocess.Popen(['pep8',
42 '--repeat',
43
44=== modified file 'license_protected_downloads/tests/test_views.py'
45--- license_protected_downloads/tests/test_views.py 2012-11-28 12:08:35 +0000
46+++ license_protected_downloads/tests/test_views.py 2012-11-29 10:18:21 +0000
47@@ -32,6 +32,7 @@
48 def tearDown(self):
49 settings.SERVED_PATHS = self.old_served_paths
50
51+
52 class ViewTests(BaseServeViewTest):
53 def test_license_directly(self):
54 response = self.client.get('/licenses/license.html', follow=True)
55@@ -528,7 +529,7 @@
56 file_path = os.path.join(TESTSERVER_ROOT, target_file)
57 os.chdir(file_path)
58 ret = _process_include_tags(
59- 'Test <linaro:include file="README">README is missing' + \
60+ 'Test <linaro:include file="README">README is missing'
61 '</linaro:include> html')
62 self.assertEqual(ret, r"Test Included from README html")
63 os.chdir(old_cwd)
64
65=== modified file 'scripts/publish_to_snapshots.py'
66--- scripts/publish_to_snapshots.py 2012-10-23 09:34:56 +0000
67+++ scripts/publish_to_snapshots.py 2012-11-29 10:18:21 +0000
68@@ -106,8 +106,8 @@
69 def validate_args(self, args):
70 # Validate that all the required information
71 # is passed on the command line
72- if (args.job_type == None or args.job_name == None or
73- args.build_num == None):
74+ if (args.job_type is None or args.job_name is None or
75+ args.build_num is None):
76 raise PublisherArgumentException(
77 "\nYou must specify job-type, job-name and build-num")
78
79@@ -138,7 +138,7 @@
80 def validate_paths(self, args, uploads_path, target_path):
81 build_dir_path = target_dir_path = None
82 ret_val = self.jobname_to_target_subdir(args, args.job_name)
83- if ret_val != None:
84+ if ret_val is not None:
85 if args.job_type == "android":
86 build_path = '/'.join([args.job_type, args.job_name,
87 str(args.build_num)])
88@@ -220,7 +220,7 @@
89 if os.path.islink(symlink_path):
90 os.unlink(symlink_path)
91
92- if os.path.islink(header_symlink_path):
93+ if os.path.islink(header_symlink_path):
94 os.unlink(header_symlink_path)
95
96 os.symlink(header_path, header_symlink_path)
97@@ -350,7 +350,7 @@
98 try:
99 build_dir_path, target_dir_path = publisher.validate_paths(
100 args, uploads_path, target_path)
101- if build_dir_path == None or target_dir_path == None:
102+ if build_dir_path is None or target_dir_path is None:
103 print "Problem with build/target path, move failed"
104 return FAIL
105 ret = publisher.move_artifacts(args, build_dir_path, target_dir_path)
106
107=== modified file 'settings.py'
108--- settings.py 2012-10-24 09:44:06 +0000
109+++ settings.py 2012-11-29 10:18:21 +0000
110@@ -101,7 +101,7 @@
111 ROOT_URLCONF = ROOT_DIR + '.urls'
112
113 TEMPLATE_DIRS = (
114- os.path.join(PROJECT_ROOT, "templates" ),
115+ os.path.join(PROJECT_ROOT, "templates"),
116 )
117
118 INSTALLED_APPS = (

Subscribers

People subscribed via source and target branches