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
=== modified file 'license_protected_downloads/render_text_files.py'
--- license_protected_downloads/render_text_files.py 2012-11-21 17:08:15 +0000
+++ license_protected_downloads/render_text_files.py 2012-11-29 10:18:21 +0000
@@ -76,8 +76,9 @@
76 ubuntupaths = cls.dirEntries(path, files_list=settings.LINUX_FILES)76 ubuntupaths = cls.dirEntries(path, files_list=settings.LINUX_FILES)
77 if len(androidpaths) > 0 and len(ubuntupaths) > 0:77 if len(androidpaths) > 0 and len(ubuntupaths) > 0:
78 # Files from ANDROID_FILES and LINUX_FILES exist in the same dir78 # Files from ANDROID_FILES and LINUX_FILES exist in the same dir
79 raise MultipleFilesException("Both Android and Ubuntu HOWTO " \79 raise MultipleFilesException(
80 "files are found, which is unsupported.")80 "Both Android and Ubuntu HOWTO files "
81 "are found, which is unsupported.")
81 else:82 else:
82 if len(androidpaths) > 0:83 if len(androidpaths) > 0:
83 return androidpaths84 return androidpaths
8485
=== modified file 'license_protected_downloads/tests/helpers.py'
--- license_protected_downloads/tests/helpers.py 2012-11-28 12:08:35 +0000
+++ license_protected_downloads/tests/helpers.py 2012-11-29 10:18:21 +0000
@@ -39,4 +39,3 @@
39 target.write(data)39 target.write(data)
40 target.close()40 target.close()
41 return full_path41 return full_path
42
4342
=== modified file 'license_protected_downloads/tests/test_pep8.py'
--- license_protected_downloads/tests/test_pep8.py 2012-08-17 15:09:12 +0000
+++ license_protected_downloads/tests/test_pep8.py 2012-11-29 10:18:21 +0000
@@ -23,11 +23,8 @@
2323
24class TestPep8(TestCase):24class TestPep8(TestCase):
25 def test_pep8(self):25 def test_pep8(self):
26 # Errors we have to ignore for now:26 # Errors we have to ignore for now: use pep8 error codes like 'E202'.
27 # * E202 whitespace before ')' or ']'27 ignore = []
28 # E202 is actually only reported with the natty version of pep8 and
29 # can be re-enabled once we drop support for natty.
30 ignore = ['E202']
31 # Ignore return code.28 # Ignore return code.
32 proc = subprocess.Popen(['pep8',29 proc = subprocess.Popen(['pep8',
33 '--repeat',30 '--repeat',
3431
=== modified file 'license_protected_downloads/tests/test_views.py'
--- license_protected_downloads/tests/test_views.py 2012-11-28 12:08:35 +0000
+++ license_protected_downloads/tests/test_views.py 2012-11-29 10:18:21 +0000
@@ -32,6 +32,7 @@
32 def tearDown(self):32 def tearDown(self):
33 settings.SERVED_PATHS = self.old_served_paths33 settings.SERVED_PATHS = self.old_served_paths
3434
35
35class ViewTests(BaseServeViewTest):36class ViewTests(BaseServeViewTest):
36 def test_license_directly(self):37 def test_license_directly(self):
37 response = self.client.get('/licenses/license.html', follow=True)38 response = self.client.get('/licenses/license.html', follow=True)
@@ -528,7 +529,7 @@
528 file_path = os.path.join(TESTSERVER_ROOT, target_file)529 file_path = os.path.join(TESTSERVER_ROOT, target_file)
529 os.chdir(file_path)530 os.chdir(file_path)
530 ret = _process_include_tags(531 ret = _process_include_tags(
531 'Test <linaro:include file="README">README is missing' + \532 'Test <linaro:include file="README">README is missing'
532 '</linaro:include> html')533 '</linaro:include> html')
533 self.assertEqual(ret, r"Test Included from README html")534 self.assertEqual(ret, r"Test Included from README html")
534 os.chdir(old_cwd)535 os.chdir(old_cwd)
535536
=== modified file 'scripts/publish_to_snapshots.py'
--- scripts/publish_to_snapshots.py 2012-10-23 09:34:56 +0000
+++ scripts/publish_to_snapshots.py 2012-11-29 10:18:21 +0000
@@ -106,8 +106,8 @@
106 def validate_args(self, args):106 def validate_args(self, args):
107 # Validate that all the required information107 # Validate that all the required information
108 # is passed on the command line108 # is passed on the command line
109 if (args.job_type == None or args.job_name == None or109 if (args.job_type is None or args.job_name is None or
110 args.build_num == None):110 args.build_num is None):
111 raise PublisherArgumentException(111 raise PublisherArgumentException(
112 "\nYou must specify job-type, job-name and build-num")112 "\nYou must specify job-type, job-name and build-num")
113113
@@ -138,7 +138,7 @@
138 def validate_paths(self, args, uploads_path, target_path):138 def validate_paths(self, args, uploads_path, target_path):
139 build_dir_path = target_dir_path = None139 build_dir_path = target_dir_path = None
140 ret_val = self.jobname_to_target_subdir(args, args.job_name)140 ret_val = self.jobname_to_target_subdir(args, args.job_name)
141 if ret_val != None:141 if ret_val is not None:
142 if args.job_type == "android":142 if args.job_type == "android":
143 build_path = '/'.join([args.job_type, args.job_name,143 build_path = '/'.join([args.job_type, args.job_name,
144 str(args.build_num)])144 str(args.build_num)])
@@ -220,7 +220,7 @@
220 if os.path.islink(symlink_path):220 if os.path.islink(symlink_path):
221 os.unlink(symlink_path)221 os.unlink(symlink_path)
222222
223 if os.path.islink(header_symlink_path):223 if os.path.islink(header_symlink_path):
224 os.unlink(header_symlink_path)224 os.unlink(header_symlink_path)
225225
226 os.symlink(header_path, header_symlink_path)226 os.symlink(header_path, header_symlink_path)
@@ -350,7 +350,7 @@
350 try:350 try:
351 build_dir_path, target_dir_path = publisher.validate_paths(351 build_dir_path, target_dir_path = publisher.validate_paths(
352 args, uploads_path, target_path)352 args, uploads_path, target_path)
353 if build_dir_path == None or target_dir_path == None:353 if build_dir_path is None or target_dir_path is None:
354 print "Problem with build/target path, move failed"354 print "Problem with build/target path, move failed"
355 return FAIL355 return FAIL
356 ret = publisher.move_artifacts(args, build_dir_path, target_dir_path)356 ret = publisher.move_artifacts(args, build_dir_path, target_dir_path)
357357
=== modified file 'settings.py'
--- settings.py 2012-10-24 09:44:06 +0000
+++ settings.py 2012-11-29 10:18:21 +0000
@@ -101,7 +101,7 @@
101ROOT_URLCONF = ROOT_DIR + '.urls'101ROOT_URLCONF = ROOT_DIR + '.urls'
102102
103TEMPLATE_DIRS = (103TEMPLATE_DIRS = (
104 os.path.join(PROJECT_ROOT, "templates" ),104 os.path.join(PROJECT_ROOT, "templates"),
105 )105 )
106106
107INSTALLED_APPS = (107INSTALLED_APPS = (

Subscribers

People subscribed via source and target branches