Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Updating builder for scripts that have no name

  • Loading branch information...
commit 4baeab6b90c820bb3a5c6f4f93e69c8ffa032b27 1 parent c62b776
@anutron authored
View
2  django/src/depender/core.py
@@ -325,7 +325,7 @@ class ScriptsJsonFileData(object):
"""Source file pointed to by a scripts.json"""
def __init__(self, module_name, shortname, filename, package, metadata):
self.filename = filename
- self.shortname = shortname
+ self.shortname = shortname.split('/')[1]
self.content = _force_unicode(file(filename).read())
self.package = package
self.metadata = metadata
View
16 django/src/depender/templates/builder.mako
@@ -65,11 +65,21 @@
<tr class="middle unchecked">
<td class="first check">
<div class="checkbox"></div>
- <input type="checkbox" name="require" value="${p}/${filedata.metadata['name']}" data-depends="${', '.join(get_depends(p, filedata.filename))}" />
+ <%
+ if filedata.metadata.has_key('name'):
+ name = filedata.metadata['name']
+ else:
+ name = filedata.shortname.split('/')[-1]
+
+ description = "no description"
+ if filedata.metadata.has_key('description'):
+ description = filedata.metadata['description']
+ %>
+ <input type="checkbox" name="require" value="${p}/${name}" data-depends="${', '.join(get_depends(p, filedata.filename))}" />
</td>
- <td class="middle file">${filedata.metadata['name']}</td>
+ <td class="middle file">${name}</td>
<td class="middle provides">${', '.join(get_provides(p, filedata.filename))}</td>
- <td class="last description"><p>${filedata.metadata['description']}</p></td>
+ <td class="last description"><p>${description}</p></td>
</tr>
% endfor
Please sign in to comment.
Something went wrong with that request. Please try again.