Merge lp:~stevanr/linaro-license-protection/fix-textile-version-problems into lp:~linaro-automation/linaro-license-protection/trunk

Proposed by Stevan Radaković
Status: Merged
Approved by: Stevan Radaković
Approved revision: 139
Merged at revision: 139
Proposed branch: lp:~stevanr/linaro-license-protection/fix-textile-version-problems
Merge into: lp:~linaro-automation/linaro-license-protection/trunk
Diff against target: 68 lines (+4/-15)
3 files modified
license_protected_downloads/render_text_files.py (+3/-3)
license_protected_downloads/tests/test_render_text_files.py (+0/-11)
license_protected_downloads/views.py (+1/-1)
To merge this branch: bzr merge lp:~stevanr/linaro-license-protection/fix-textile-version-problems
Reviewer Review Type Date Requested Status
Georgy Redkozubov Approve
Review via email: mp+130858@code.launchpad.net

Description of the change

Support textile 2.1.4.

To post a comment you must log in.
Revision history for this message
Georgy Redkozubov (gesha) wrote :

Good.

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-10-19 15:17:48 +0000
3+++ license_protected_downloads/render_text_files.py 2012-10-22 17:04:19 +0000
4@@ -1,6 +1,6 @@
5 import os
6 import re
7-from textile.textilefactory import TextileFactory
8+import textile
9 from collections import OrderedDict
10 from django.conf import settings
11
12@@ -36,6 +36,7 @@
13 'Firmware Update',
14 'RTSM']
15
16+
17 class MultipleFilesException(Exception):
18 pass
19
20@@ -88,8 +89,7 @@
21 def render_file(cls, filepath):
22 try:
23 file_obj = open(filepath, 'r')
24- textile_factory = TextileFactory()
25- return textile_factory.process(file_obj.read())
26+ return textile.textile(file_obj.read())
27 except:
28 # Do nothing, parsing failed.
29 pass
30
31=== modified file 'license_protected_downloads/tests/test_render_text_files.py'
32--- license_protected_downloads/tests/test_render_text_files.py 2012-10-19 11:06:33 +0000
33+++ license_protected_downloads/tests/test_render_text_files.py 2012-10-22 17:04:19 +0000
34@@ -119,14 +119,3 @@
35 sorted(RenderTextFiles.find_relevant_files(android_path)))
36 self.assertEqual(sorted(full_ubuntu_files),
37 sorted(RenderTextFiles.find_relevant_files(ubuntu_path)))
38-
39- def test_sort_paths_list_by_files_list(self):
40- path = self.make_temp_dir(empty=False, file_list=UBUNTU_FILES)
41- full_ubuntu_files = []
42- for file in UBUNTU_FILES:
43- full_ubuntu_files.append(os.path.join(path, file))
44- paths_list = RenderTextFiles.find_relevant_files(path)
45- self.assertEqual(full_ubuntu_files,
46- sorted(paths_list,
47- cmp=RenderTextFiles.sort_paths_list_by_files_list))
48- self.assertNotEqual(full_ubuntu_files, paths_list)
49
50=== modified file 'license_protected_downloads/views.py'
51--- license_protected_downloads/views.py 2012-10-22 12:48:48 +0000
52+++ license_protected_downloads/views.py 2012-10-22 17:04:19 +0000
53@@ -454,6 +454,7 @@
54 # the user back to the original directory this file is in?
55 return response
56
57+
58 def get_textile_files(request):
59
60 if request.is_ajax():
61@@ -461,7 +462,6 @@
62 if not result:
63 raise Http404
64
65- type = result[0]
66 path = result[1]
67
68 return HttpResponse(json.dumps(RenderTextFiles.find_and_render(path)))

Subscribers

People subscribed via source and target branches