--- a/candolint/adapters.py Thu Jul 07 14:11:03 2016 +0800
+++ b/candolint/adapters.py Thu Jul 07 14:23:10 2016 +0800
+class GithubAdapter(HostingAdapter):
+ def get_commit_url(self, change):
+ return '{url}/commits/{node}'.format(**{
+ 'url': self.project.url,
+ def get_branch_url(self, change):
+ return '{url}/tree/{branch}'.format(**{
+ 'url': self.project.url,
+ 'branch': change.branch
+ def get_line_url(self, change, line):
+ return '{url}/blob/{node}/{filename}#L{line}'.format(**{
+ 'url': self.project.url,
+ 'filename': line['filename'],
+ 'basename': basename(line['filename']),
+ 'line': line['line_number']
class HgwebAdapter(HostingAdapter):
def get_commit_url(self, change):
return '{url}/rev/{node}'.format(**{
--- a/candolint/models.py Thu Jul 07 14:11:03 2016 +0800
+++ b/candolint/models.py Thu Jul 07 14:23:10 2016 +0800
if self.domain == 'bitbucket.org':
return adapters.BitbucketAdapter(self)
+ elif self.domain == 'github.com':
+ return adapters.GithubAdapter(self)
elif self.domain.startswith('hg.'):
return adapters.HgwebAdapter(self)