Merge lp:~gesha/linaro-license-protection/update-dir-template into lp:~linaro-automation/linaro-license-protection/trunk

Proposed by Georgy Redkozubov
Status: Merged
Merged at revision: 119
Proposed branch: lp:~gesha/linaro-license-protection/update-dir-template
Merge into: lp:~linaro-automation/linaro-license-protection/trunk
Diff against target: 63 lines (+6/-11)
3 files modified
license_protected_downloads/tests/test_views.py (+2/-2)
license_protected_downloads/views.py (+2/-1)
templates/dir_template.html (+2/-8)
To merge this branch: bzr merge lp:~gesha/linaro-license-protection/update-dir-template
Reviewer Review Type Date Requested Status
Fathi Boudra Approve
Linaro Infrastructure Pending
Review via email: mp+121329@code.launchpad.net

Description of the change

After switching to the new django-based server almost all build scripts that rely on regexp patterns for searching builds failed.
This branch updates links part of dir_template.html so it looks like in page produced by apache before switching to django-based version of server.

To post a comment you must log in.
Revision history for this message
Fathi Boudra (fboudra) wrote :

Looks good to me.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'license_protected_downloads/tests/test_views.py'
--- license_protected_downloads/tests/test_views.py 2012-08-24 14:17:02 +0000
+++ license_protected_downloads/tests/test_views.py 2012-08-26 08:45:23 +0000
@@ -266,8 +266,8 @@
266266
267 # If we have access to the file, we will get an X-Sendfile response267 # If we have access to the file, we will get an X-Sendfile response
268 self.assertContains(response,268 self.assertContains(response,
269 r"<th></th><th>Name</th><th>License</th><th>Last modified</th>"269 r"<th></th><th>Name</th><th>Last modified</th>"
270 "<th>Size</th>")270 "<th>Size</th><th>License</th>")
271271
272 def test_not_found_file(self):272 def test_not_found_file(self):
273 target_file = "12qwaszx"273 target_file = "12qwaszx"
274274
=== modified file 'license_protected_downloads/views.py'
--- license_protected_downloads/views.py 2012-08-24 14:13:10 +0000
+++ license_protected_downloads/views.py 2012-08-26 08:45:23 +0000
@@ -54,7 +54,8 @@
54 file = os.path.join(path, file)54 file = os.path.join(path, file)
5555
56 if os.path.exists(file):56 if os.path.exists(file):
57 mtime = time.ctime(os.path.getmtime(file))57 mtime = time.strftime('%d-%b-%Y %H:%M',
58 time.localtime(os.path.getmtime(file)))
58 else:59 else:
59 # If the file we are looking at doesn't exist (broken symlink for60 # If the file we are looking at doesn't exist (broken symlink for
60 # example), it doesn't have a mtime.61 # example), it doesn't have a mtime.
6162
=== modified file 'templates/dir_template.html'
--- templates/dir_template.html 2012-07-27 18:57:32 +0000
+++ templates/dir_template.html 2012-08-26 08:45:23 +0000
@@ -4,7 +4,7 @@
4{{ header_content|safe }}4{{ header_content|safe }}
5<table>5<table>
6 <tr>6 <tr>
7 <th></th><th>Name</th><th>License</th><th>Last modified</th><th>Size</th>7 <th></th><th>Name</th><th>Last modified</th><th>Size</th><th>License</th>
8 <tr><th colspan="5"><hr></th>8 <tr><th colspan="5"><hr></th>
9 </tr>9 </tr>
10 {% if up_dir != None %}10 {% if up_dir != None %}
@@ -20,11 +20,7 @@
20 {% endif %}20 {% endif %}
2121
22{% for value in dirlist %}22{% for value in dirlist %}
23 <tr>23 <tr><td valign="top"><img src="{{ STATIC_URL }}/static/{{ value.type }}.png" alt="{{ value.type }}"/></td><td><a href="{{ value.url }}">{{ value.name }}</a></td><td align="right">{{ value.mtime }} </td><td align="right"> {% if value.type != 'folder' %}{{ value.size }}{% endif %}</td>
24 <td>
25 <img src="{{ STATIC_URL }}/static/{{ value.type }}.png" alt="{{ value.type }}"/>
26 </td>
27 <td><a href="{{ value.url }}">{{ value.name }}</a></td>
28 <td>24 <td>
29 {% if value.license_digest_list == "OPEN" %}25 {% if value.license_digest_list == "OPEN" %}
30 <i>open</i>26 <i>open</i>
@@ -34,8 +30,6 @@
34 {% endfor %}30 {% endfor %}
35 {% endif %}31 {% endif %}
36 </td>32 </td>
37 <td>{{ value.mtime }}</td>
38 <td>{% if value.type != 'folder' %}{{ value.size }}{% endif %}</td>
39 </tr>33 </tr>
40{% endfor %}34{% endfor %}
41</table>35</table>

Subscribers

People subscribed via source and target branches