---
+++
@@ -68,24 +68,28 @@
commit_stats.render_miniature_activity(img_path)
img_url = '%s/activity_%i.png' % (self.name, no)
- # Main mimetype
- commit_stats._build_tree_stats(repo.repo['refs/heads/master'].tree)
- mimetype = ''
+ # Project main language
+ if config.has_option('project', 'language'):
+ language =config.get('project', 'language')
+ else:
+ commit_stats._build_tree_stats(repo.repo['refs/heads/master'].tree)
+ mimetype = ''
- mimecount = [(mime, count) for mime, count in commit_stats.mime_type_count.iteritems() if (mime.startswith('text/x-') or mime.startswith('application/x-'))]
- mimecount.sort(key=lambda x: -x[1])
+ mimecount = [(mime, count) for mime, count in commit_stats.mime_type_count.iteritems() if (mime.startswith('text/x-') or mime.startswith('application/x-'))]
+ mimecount.sort(key=lambda x: -x[1])
- # TODO: Count the number of lines to determine the mimetype
- # as there is the same number of file with the same mimetype
- # if len(mimecount) > 1 and mimecount[0][1] == mimecount[1][1]:
+ # TODO: Count the number of lines to determine the mimetype
+ # as there is the same number of file with the same mimetype
+ # if len(mimecount) > 1 and mimecount[0][1] == mimecount[1][1]:
- if len(mimecount):
- mimetype = mimecount[0][0]
+ if len(mimecount):
+ mimetype = mimecount[0][0]
- if mimetype.startswith('text/x-'):
- mimetype = mimetype.replace('text/x-', '').title()
- elif mimetype.startswith('application/x-'):
- mimetype = mimetype.replace('application/x-', '').title()
+ if mimetype.startswith('text/x-'):
+ mimetype = mimetype.replace('text/x-', '').title()
+ elif mimetype.startswith('application/x-'):
+ mimetype = mimetype.replace('application/x-', '').title()
+ language = mimetype
# Last modification date
last_modified_time = datetime.fromtimestamp(repo.repo['refs/heads/master'].author_time)
@@ -100,7 +104,7 @@
'activity': img_url,
'last_modified': last_modified,
'last_modified_time': last_modified_time,
- 'mimetype': mimetype,
+ 'language': language,
})
namespace['projects'].sort(key=lambda x: x['last_modified_time'])
namespace['projects'].reverse()
---
+++
@@ -21,7 +21,7 @@
#end if
</td>
<td><a href="$project.url"><b>$project.name</b></a></td>
- <td>$project.mimetype</td>
+ <td>$project.language</td>
<td>$project.last_modified</td>
<td>
#if $project.repository_url
Generated with KisssPM